Removing "Connection" response header

Not applicable

I'm trying to remove the "Connection" : "close" header from the response.

I tried removing it using an Assign Message Policy in the Proxy Endpoints' PreFlow but it didn't do it.

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="removeResponseHeaders"> <DisplayName>removeResponseHeaders</DisplayName>

<Remove>

<Headers> <Header name="Connection"/>

</Headers>

</Remove>

<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/>

</AssignMessage>

Please let me know how we can remove Connection header from response.

1 2 1,035
2 REPLIES 2

Not applicable

I wonder if this is happening for the reasons suggested by Dino in this answer. https://community.apigee.com/questions/29252/unable-to-remove-header-in-raisefault-policy.html

Also, Carlos suggests in this answer another method to remove the content of the header using a JavaScript policy. There might be a way to delete headers too using delete command. https://community.apigee.com/questions/10913/how-do-i-remove-the-attributes-of-an-header-exampl.html

@Diego Zuluaga

Looks like Connection header is also injected by Apigee Router.

https://community.apigee.com/questions/31685/removing-server-response-header.html