Forum Discussion
Krzysztof_Kozlo
Nimbostratus
Jul 20, 2006Fetching multiple headers
We are attempting to use Universal Persistence to work around source IP addresses being obscured by intervening infrastructure (i.e. proxy servers). The proxy servers in our environment insert an X-F...
hoolio
Cirrostratus
May 02, 2007I ran into this issue of getting the values for headers with identical names (mainly worrying about Set-Cookie). It looks like the 'HTTP::header values ' command Bl0ndie mentioned has been added in 9.4:
when HTTP_RESPONSE {
insert some test headers with the same name
HTTP::header insert header_1 value_1
HTTP::header insert header_1 value_2
HTTP::header insert header_1 value_3
test a few options for parsing the headers
log local0. "\[HTTP::header header_1\]: [HTTP::header header_1]"
log local0. "\[HTTP::header value header_1\]: [HTTP::header value header_1]"
log local0. "\[HTTP::header values header_1\]: [HTTP::header values header_1]"
}
Log output:
[HTTP::header header_1]: value_3
[HTTP::header value header_1]: value_3
[HTTP::header values header_1]: value_1 value_2 value_3
But I'm wondering if multiple headers with the same name could be handled better.
With the 'values' command, I can actually get the values of headers that exist multiple times (which is a good improvement over past versions). But I have to check to see if a header name exists more than once and then parse the list of values.
Could a method for getting the values of the headers by their index be added? Before I saw this post, I assumed that the 'HTTP::header at $index' command would return the value of a header at $index. I'm not sure what use there is in getting the header name at a specific index. Maybe 'HTTP::header at $index' could be changed to return the value of the header? Else, maybe a new command could be added, like 'HTTP::header value at $index'.
I'll submit an RFE on this, but I figured I'd check here first to find out more on the logic for the existing functionality.
Thanks,
Aaron
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