XFF Universal Persistence iRule
Updated Jun 06, 2023
Version 2.0Was this article helpful?
Yann, You are correct for most headers where multiple headers exist with the same name however the XFF header gets appended, i.e. Format is;
X-Forwarded-For: client, proxy1, proxy2
So there should only ever be a single X-Forwarded-For header within a HTTP request with the first IP address being closest to the original. I could do the following:
[getfield [HTTP::header X-Forwarded-For] "," 1]
However I test a lot of code directly in TCL so the getfield commend is not valid but this is just down to personal preference.