Forum Discussion

CraigM_17826's avatar
CraigM_17826
Icon for Altostratus rankAltostratus
Jul 01, 2010

Inserting a custom header

Hi all,

our WebSphere devleopers have requested we insert a custom header that contains the complete URL the client requested, including the protocol (http:// or https:.//).

At the moment we are using the Request Header Insert option in the custom profile, and altough I can use [HTTP::host][HTTP::uri] in the header I can't seem to find a function that will return the current protocol. I suppose I could do this within an iRule if need be but was wondering if it's possible to do via the profile without resorting to hard coding literal https:// in the header field. ex.
 new-header-name:https://[HTTP:host][HTTP::uri]
does work but I just try to avid hard coding things unless there is no alternative.

Anyway comments welcome.

Regards

Craig

2 Replies

  • Hi Craig,

     

     

    There is no single iRule command which can be used to determine whether a request was made via HTTP or HTTPS. To see if it was HTTPS, you can check the 'SSL::cipher name' output for anything but 'none' but you have to use catch to handle the error that occurs if no cipher was used (for HTTP). So it's not something you could really use for an HTTP profile header insert. It would be simplest to create two custom HTTP profiles and hardcode the protocol in each.

     

     

    Aaron