App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
 View Only
  • 1.  Remove the Server header from the response?

    Posted 4 days ago
    Could you please advise whether it is possible to remove the Server header from the response?
    We attempted to do this using the following ESQL command at code level:
    DELETE FIELD OutputRoot.HTTPReplyHeader."Server";
    However, the change does not seem to take effect. Your guidance on this would be greatly appreciated.


    ------------------------------
    Vije Prathap
    ------------------------------


  • 2.  RE: Remove the Server header from the response?

    Posted 3 days ago

    Hi Vije

    Can you explain your setup? How is(are) your flow(s) build?

    DELETE FIELD works, if you put the compute mode of your compute node to include message. I just tried it with a HTTPRequest node and I am able to delete the HTTPResponseHeader."Server" field.

    Before the Compute node, full http response:

    Deleting the Server field:

    After the compute node, the stripped response:

    Or do you mean when constructing your httpreply? You can find more info on using http on this page: Working with HTTP flows

    This inclused the usage of http headers for the httpreply node.



    ------------------------------
    Regards
    Matthias Blomme
    Integration Specialist
    Integration Designers
    Turnhout
    ------------------------------



  • 3.  RE: Remove the Server header from the response?

    Posted 3 days ago

    Don't do it before sending the response. Do it after receiving the response.



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 4.  RE: Remove the Server header from the response?

    Posted 3 days ago

    Hello Vije,  

     You should be to delete the field but you need to ensure you have the correct name of the field and the path.  

    I tried it out locally and in my case I deleted it with 

    DELETE FIELD OutputRoot.HTTPInputHeader."X-Server-Name";

    I would check you have the field and path name correct.

    There are several ways to check it but I usually use the flow exerciser and click on the message

    envelope between your compute node and your HTTP reply node.

    Here is my record message with the above field deleted by the compute node:

    Reagrds



    ------------------------------
    Paul Lacy
    ------------------------------



  • 5.  RE: Remove the Server header from the response?

    Posted 2 days ago

    Further to the other replies (which are all good in terms of how you can manipulate and delete the various entries in the logical tree) ... there are also behaviours built into the HTTPReply node for manufacturing the actual headers sent on the wire based on the content in the logical tree. Some of the fields sent on the wire (such as the content length) are calculated for you and are therefore not directly under the user's control. The Server property will default to "IBM App Connect Enterprise" but you can define your own chosen value (using httpServerName) in the server.conf.yaml file which can be anything you like. Unfortunately it is not possible to override the value on a message by message basis (ie using LocalEnvironment) nor is it possible to remove the Server property entirely.  This old thread on stackoverflow explored some of these other issues too: https://stackoverflow.com/questions/75081413/how-to-remove-default-http-headers-from-a-soapreply-node



    ------------------------------
    Ben Thompson
    IBM UK
    ------------------------------