Forum Discussion
hooleylist
Sep 29, 2009Cirrostratus
An initial request of http://www.foo.com/bar?a=b should match this clause:
} elseif { [HTTP::uri] contains "?" } {
http://www.foo.com/bar?a=b -> http://www.foo.com/bar?a=b&p1=v1
HTTP::uri "[HTTP::uri]&$query_args"
and the query string argument should be appended after an ampersand. Can you add logging to each case and log the output of the URI update using this as an example:
when HTTP_REQUEST {
set query_args "p1=v1"
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to [HTTP::host][HTTP::uri]. Appending $query_args."
if { [HTTP::uri] ends_with "?" } {
http://www.foo.com/bar? -> http://www.foo.com/bar?p1=v1
HTTP::uri "[HTTP::uri]$query_args"
log local0. "[IP::client_addr]:[TCP::client_port]: URI ends with ?"
} elseif { [HTTP::uri] contains "?" } {
http://www.foo.com/bar?a=b -> http://www.foo.com/bar?a=b&p1=v1
HTTP::uri "[HTTP::uri]&${query_args}"
log local0. "[IP::client_addr]:[TCP::client_port]: URI contains ?"
} else {
http://www.foo.com/bar -> http://www.foo.com/bar?p1=v1
HTTP::uri "[HTTP::uri]?$query_args"
log local0. "[IP::client_addr]:[TCP::client_port]: URI does not contain ?"
}
}
when HTTP_REQUEST priority 501 {
log local0. "[IP::client_addr]:[TCP::client_port]: (501) Updated URI: [HTTP::uri]"
}
Thanks,
Aaron