Search code examples
wso2wso2-api-managerapache-synapsewso2-esb

WSO2 API Manager 3.2.0 - Cannot remove "Server" header


According to official docs defining a custom out sequence and adding <property name="CustomTransportHeader" scope="transport" action="remove"/> would remove any unwanted header from api response, yet I'm not getting any success defining a custom global out sequence and trying to remove Server out of response headers nor any other headers as well.

 * Mark bundle as not supporting multiuse
 < HTTP/1.1 200 
 < X-Content-Type-Options: nosniff
 < X-XSS-Protection: 1; mode=block
 < Date: Tue, 18 May 2021 14:37:47 GMT
 < Content-Type: application/json
 < Transfer-Encoding: chunked
 < Server: WSO2 Carbon Server

Here's the custom out sequence which I placed in{$APIM_HOME}/repository/deployment/server/synapse_configs/sequences folder as a new xml file and got acknowledged of it's deployment by log:

 <sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--Out"> 
  <property name="Server" scope="transport" action="remove"/>
 <log level="custom">
   <property name="TRACE" value="API Mediation Extension"/>
 </log>
 </sequence>

how should one get this done? what's the problem here?


Solution

  • For anybody struggling with this, all you have to do is to add this Entry into your deployment.toml file:

    [transport.https.properties]
    server = "something"
    

    this would change the Server in response headers to your desired value. using custom sequences can do no good as you don't want to modify your own defined APIs and your request is not passing through it at all.