Forum Discussion
hooleylist
Jun 13, 2011Cirrostratus
Hi Mike,
You can use catch like this:
when HTTP_REQUEST {
Use catch to handle any error. Save the output to $result for logging of an error or use if successful.
if {[catch {HTTP::method} result]}{
log local0. "[IP::client_addr]:[TCP::client_port]: Error running HTTP::method ($result). Headers: [HTTP::request]"
reject
} else {
Add the rest of the code here which is triggered if the HTTP::method command succeeds
Check if HTTP::method returned HEAD
if {$result eq "HEAD"}{
...
}
}
}
Also, I don't think you'll ever see two question marks in the URI as a question mark delineates the path and the query string. And you normally wouldn't see two of the same query string parameter names like tag=1&tag=1.
Aaron