I'm trying to remove the "Set-Cookie" : header from the response.
I tried removing it using an Assign Message Policy in the Proxy Endpoints' PreFlow but it didn't do it.
Then tried the same in PostFlow and then in TargetEndPoints' pre/post flow - still didn't work.
Also see the screenshot where I want the policy to be executed
Here's the policy I have in place:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="AM-RemoveResponseSetCookieHeader"> <DisplayName>AM-RemoveResponseSetCookieHeader</DisplayName> <AssignTo createNew="false" transport="http" type="response"/> <Properties/> <Remove> <Headers> <Header name="Set-Cookie"/> </Headers> </Remove> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </AssignMessage>
Solved! Go to Solution.
Hi @GAURAV. A few suggestions...
<Response>
element of your Proxy Endpoint. The screenshot you've shared unfortunately does not show the attachment. FWIW, you're fine attaching this particular policy to either the Proxy or Target endpoint; it just has to be in the response flow.Set-Cookie
headers. In this case, please see this page of the documentation for a note regarding multiple headers and how they can be handled.// remove Set-Cookie header from response context.removeVariable('response.header.Set-Cookie'); // in the case of multiple Set-Cookie headers, specify which instance context.removeVariable('response.header.Set-Cookie.1'); context.removeVariable('response.header.Set-Cookie.2'); // etc.
Based on the information you've provided so far, everything else appears to be fine.
Hi @GAURAV. A few suggestions...
<Response>
element of your Proxy Endpoint. The screenshot you've shared unfortunately does not show the attachment. FWIW, you're fine attaching this particular policy to either the Proxy or Target endpoint; it just has to be in the response flow.Set-Cookie
headers. In this case, please see this page of the documentation for a note regarding multiple headers and how they can be handled.// remove Set-Cookie header from response context.removeVariable('response.header.Set-Cookie'); // in the case of multiple Set-Cookie headers, specify which instance context.removeVariable('response.header.Set-Cookie.1'); context.removeVariable('response.header.Set-Cookie.2'); // etc.
Based on the information you've provided so far, everything else appears to be fine.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |