Forum Discussion
CraigM_17826
Altocumulus
Jul 01, 2010Inserting 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
- hoolio
Cirrostratus
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 - CraigM_17826
Altocumulus
thanks hoolio, thetas exactly what I have ended up doing, Regards .Craig
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
