Forum Discussion
jaskel_106221
Aug 27, 2007Nimbostratus
Ok, ok....this always happens to me. The minute I post a question, I figure out what I was doing wrong. So, this is what I ended up with:
when HTTP_REQUEST {
Check to see if the header already exists
if { [ string tolower HTTP::header] starts_with "client-ip"} {
If it does, remove the current header element
HTTP::header remove "Client-IP"
The insert our own assuring that only one element exists in the
header
HTTP::header insert "Client-IP" [IP::remote_addr]
}
else {
If it doesn't already exist, insert it.
HTTP::header insert "Client-IP" [IP::remote_addr]
}
}
And it appears to work. I get the inserted header. Now I just have to test if it cleans out the header if it finds the Client-IP portion already in the header on the initial request.
Thanks for anyone who looked and was thinking about replying!
-James