Forum Discussion
Rory_Hewitt_F5_
Sep 30, 2015Cirrus
Do I need to check HTTP::header exists before checking value?
I feel like this is a simple question, but I can't seem to find a definitive answer...
To check the value of a particular HTTP header, I can do this:
if { [HTTP::header Origin] ends_with "...
Hannes_Rapp
Sep 30, 2015Nimbostratus
Hello,
Use the first sample as it appears to be the most efficient and performance-friendly. If the header "Origin" is not found in the client's request, the block of code after the conditional statement will not be processed. There will be no TCL errors or any issues due.
Personally, I would use
if { [HTTP::header value "Origin"] ends_with "example.com" }
as the conditional statement, just for clarity reasons.
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