Forum Discussion
Levin_Chen_1516
Nimbostratus
Dec 26, 2008X-Forwarded-For problem?
Hi
I have a iRules as follow:
when HTTP_REQUEST {
if { [HTTP::header exists "X-Forwarded-For"] } {
set xForwardedNum [HTTP::header count...
hoolio
Cirrostratus
Dec 29, 2008Oddly enough, HTTP::header count "header-name" starts counting at 0. So you can't tell just from using HTTP::header count "X-Forwarded-For" whether there is no header or one header. I'd call this a bug. If you'd like F5 to address this, you could open a case with F5 Support.
A simple workaround would be to set the HTTP profile to remove the X-Forwarded-For header in the 'Request Header Erase' field. You could then enable the 'Insert XForwarded For' option in the profile and avoid using an iRule altogether. The header to erase option is handled before the insert. So any existing XFF headers would be removed and then LTM would insert a new XFF header with the client IP address it received.
Aaron
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
