Dana_19378
Nov 14, 2013Nimbostratus
HTTP Events in iRules
I have seen some iRules that appear to violate the understnding I have of the HTTP_REQUEST and HTTP_RESPONSE events.
Assuming an iRule has both events like below, my assumption up until now is that each time the rule executes, no values are saved from the previous execution, and both events cannot coexist during the same execution since the current state is either REQUEST or RESPONSE. Based on this, I assume the if statement in the below 'when HTTP_RESPONSE' would never be true in the below example, and { set a "bar" } would never happen. Am I mistaken?
rule fubar {
when HTTP_REQUEST {
set a "foo"
}
when HTTP_RESPONSE {
if ($a equals "foo") {
set a "bar"
}
}
}
Thanks