Forum Discussion
Jonathan_Landis
Nimbostratus
Feb 09, 2006Multiple message-header fields with the same field-name
The following rule logs the "Cookie" header of http requests:
when HTTP_REQUEST {
set ch [HTTP::header "Cookie"]
if {$ch != ""} {log local0. "$ch"} else {log local0. "no cookie"}
}
If there are multiple cookie headers, it returns the last one. Is this a bug or a feature?
4 Replies
- The HTTP::header command will, as you found out, pull the last header with the given name.
You might want to take a look at the HTTP::cookie command for accessing cookies
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTP__cookie.html
Click here
-Joe - Jonathan_Landis
Nimbostratus
Thanks, Joe! Sometimes there are multiple "Accept" headers as well. Is there a way to collect all of them? - Colin_Walker_12Historic F5 AccountAccording to RFC 2616 there should be one Accept header, with a list of the acceptable data types in it. Click here
This can be split up into seperate variables as needed with the list commands native to TCL once you pull the header value itself.
-Colin - Jonathan_Landis
Nimbostratus
The RFC does not say there should be only one "Accept" header. See the last paragraph in section 4.2.
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
