Remove Specific Request Headers From Response
Shutdown the server if it is already running.
Open the
<API-M_HOME>/repository/deployment/server/synapse-configs/default/sequences/main.xmlfile.Add the name of the header to be removed as a property, just before the beginning of
sendmediator, as shown below<property name="<name of the header to be removed>" scope="transport" action="remove"/><property name="Accept" scope="transport" action="remove"/> <property name="X-JWT-Assertion" scope="transport" action="remove"/> <property name="Cookie" scope="transport" action="remove"/> <send/>Open the
<APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/fault.xmlfile.Add the name of the header to be removed as a property property, just before the beginning of "CORS request handler" sequence, as shown below.
<property name="<name of the header to be removed>" scope="transport" action="remove"/><property name="Accept" scope="transport" action="remove"/> <property name="X-JWT-Assertion" scope="transport" action="remove"/> <property name="Cookie" scope="transport" action="remove"/> <sequence key="_cors_request_handler_"/>Start the server.
Note : The above method removes only the specified headers from the response. If you need to remove all the headers, follow the instructions below.
Open the
<APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/main.xmlfile.Add the
TRANSPORT_HEADERSproperty, after the beginning of<out>sequence opening tag, as shown in the example below.Example
<out> <property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/>Open the
<APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/fault.xmlfile.Add the
TRANSPORT_HEADERSproperty before the<send>mediator, as shown in the example below.Example
<property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/> <send/>