Forum Discussion

adamp_1519's avatar
adamp_1519
Icon for Nimbostratus rankNimbostratus
Jul 15, 2007

web server banner

i'd like to use an iRule to strip arbitrary web-server header values.

 

 

the primary reason is the web-server, eg: "Server: IIS 6.0", however stripping any defined tag/value based string would be optimal (for X- values etc).

 

 

 

eg:

 

 

Server: Apache

 

X-Powered-By: PHP/4.3.10-18

 

 

would be nice if i could remove, or replace the text.

 

 

 

thanks in advance

3 Replies

  • Nicolas_Berthie's avatar
    Nicolas_Berthie
    Historic F5 Account
    you can look at "sanitize" command which strips every http headers in server response except those you specify.

     

     

    Hope this can help.
  • As nberthier suggested, you can use the HTTP::header functions to do this. If you know all the header names you want to remove from the response sent to the client, you can use 'HTTP::header remove "header name"'.

     

     

    Or, if you know all of the headers you want to keep you can use 'HTTP::header sanitize header_1 header_2'.

     

     

    The first command will remove the headers listed. The second command will remove all but the headers listed.

     

     

    Lastly, if you want to leave the headers in, but replace them, you can use 'HTTP::header replace []'.

     

     

    You can check the HTTP::header page on the wiki for more detail and some examples:

     

     

    Click here

     

     

    Aaron