Forum Discussion
hooleylist
Apr 20, 2009Cirrostratus
Hi kky,
Sure, here is an example:
when HTTP_REQUEST {
Check if some condition in the request is true
if {[HTTP::path] starts_with "/test/string"}{
Track that we want to insert a header in the response
set insert_response_header 1
} else {
Track that we do not want to insert a header in the response
set insert_response_header 0
}
}
when HTTP_RESPONSE {
Check if we're inserting a header in the response
if {$insert_response_header}{
Insert the header
HTTP::header insert "my_header_name" "my_header_value"
}
}
Aaron