- Shutdown the server if it is already running.
- Open <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/main.xml
Add the below property just before the beginning of "send" mediator.
<property name="<name of the header to be removed>" scope="transport" action="remove"/>
Eg : (XXXX - is the name of the header to be removed). . <property name="Accept" scope="transport" action="remove"/> <property name="X-JWT-Assertion" scope="transport" action="remove"/> <property name="XXXX" scope="transport" action="remove"/> <send/> . .
- Open <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/fault.xml
Add the below property just before the beginning of "CORS request handler" sequnce.
<property name="<name of the header to be removed>" scope="transport" action="remove"/>
Eg : (XXXX - is the name of the header to be removed). . <property name="Accept" scope="transport" action="remove"/> <property name="X-JWT-Assertion" scope="transport" action="remove"/> <property name="XXXX" 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 there is a need to remove all the headers, please follow the instructions below.
In <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/main.xml file, add the below property just after the beginning of <out> sequence opening tag.
<property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/>
Eg. . <out> <property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/> . .
In <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/fault.xml file, add the below property just after the <send> mediator.
<property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/>
. . <property name="TRANSPORT_HEADERS" action="remove" scope="axis2"/> <send/> . .