Forum Discussion
wlepkin_98758
Apr 12, 2012Nimbostratus
string range arguments
Hi, I'm trying to capture the first x-forwarded-for header value in an http request. There's probably a more efficient way to do this, but this is what I came up with:
when HTTP_REQUEST {
...
wlepkin_98758
Apr 13, 2012Nimbostratus
Hoolio/Aaron --
Wow! I figured there was a more efficient way, but two lines is great! Works very well, thanks.
Antony --
Thanks for your comments. I'm certainly no expert on http, but apparently devices that insert x-forwarded-for headers (such as the F5) always just append a new one at the end, regardless of how many are already there. In our case, the request may come in via an Akamai server and then go through our F5, and each of those devices puts in its own x-forwarded-for header, so your code above would not work for us because you assume that there is only one.
Wayne
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