Forum Discussion
hooleylist
Jun 23, 2010Cirrostratus
Hi Bruce,
The values for most HTTP:: commands are cached in the same event of the same priority. To log the updated value, you can add a second HTTP_REQUEST event which runs after the default priority of 500:
when HTTP_REQUEST {
Check if some condition is true?
if { [string tolower [HTTP::host]] eq "search.devint.lpo" and [HTTP::path] eq "/listing" and [HTTP::query] contains "Ntt"} {
Log the original Host and URI request
log local0. "Original Client Request is: [HTTP::header value host][HTTP::uri]"
Rewrite the URI with the original path and the query string replaced
with just the Ntt parameter value set for the q parameter
HTTP::uri "/globalSearch?q=[URI::query "?&[HTTP::query] &Ntt"]"
Update the host header
HTTP::header replace Host "www.devint.lpo"
}
}
when HTTP_REQUEST priority 501 {
Log the modified Host and URI
log local0. "(501) Modified Client Request is: [HTTP::header value Host][HTTP::uri]"
}
Aaron