Forum Discussion
Joe_Hsy_45207
Nimbostratus
Nov 20, 2007how to detect potential conflict with other iRule?
Hi,
We have a tool which uses iControl to dynamically add an iRule to a virtual server and it is important to ensure that the iRule we add do not conflict with existing iRules (or other iRules added later).
Specifically, if there is another iRule which calls HTTP::redirect or HTTP:respond at HTTP_REQUEST event, our iRule must not execute the HTTP_REQUEST block afterwards since our iRule makes a change to the HTTP header (which is not allowed after those two commands). Unfortunately, instead of a simple failure, this break the request and result in error showing at the client's browser.
We've used the priority to ensure that our HTTP_REQUEST block executes first (e.g. when HTTP_REQUEST priority 0 {...}) and that should work most of the time. However, if another iRule event block also has priority 0, there is still a chance for another iRule to get execute first.
Is there a way to know if HTTP::redirect or HTTP:Respond has already been called by another iRule, so that our iRule would simple skip execution?
Thanks!
//Joe
- There is no built in way to determine this but you can add the logic to your iRules with session variables.
when HTTP_REQUEST priority 100 { set ALREADY_RESPONDED 1 HTTP::redirect "http://www.foo.com" }
when HTTP_REQUEST priority 200 { if { ![info exists ALREADY_RESPONDED] } { HTTP response not yet sent, continuing with iRule... } }
- Joe_Hsy_45207
Nimbostratus
Hi Joe, - Joe_Hsy_45207
Nimbostratus
Hi Joe,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects