Conditional request header transformation

Hi

I’m working with Tyk Endpoints and APIs that regularly remove and add headers using context variables and session metadata

The use case i’m confronted with is a situation where I need conditional checks in my header transformation.
Basically check whether a header is set (or not) inside the request, and if so decide to replace it (or not) with a session metadata value

I’m confused if Go templates described for request body transformation could be used here for this conditional check

Thanks

@M2S Hello and welcome to the community :tada:

You can achieve this via custom plugins

Go templates can’t be used for header transformations. Only for body transformations.

1 Like