XFF Universal Persistence iRule
Problem this snippet solves: Simple iRule to read the XFF header on an incoming HTTP Request and use a Universal Persistence ID.
Orginal iRule found to have an issue with multiple IP addresses in th...
Updated Jun 06, 2023
Version 2.0Andy_McGrath
Cumulonimbus
Joined November 14, 2005
Yann_Desmarest
Jul 25, 2016Cirrus
Hi,
I recommand you to change :
[lindex [ split [HTTP::header X-Forwarded-For] "," ] 0]
by
[getfield [lindex [HTTP::header values X-Forwarded-For] 0] "," 1]
If the request contains multiple X-Forwarded-For headers, your code just take the latest header value. Not the first one.