detect prior http redirect or respond
Problem this snippet solves: Summary: Detect a prior HTTP redirect or response to avoid a runtime TCL error
iRule Methodology:
This iRule detects when this or a prior iRule has issued an HTTP re...
Published Mar 17, 2015
Version 1.0hooleylist
Cirrostratus
Joined September 08, 2005
hooleylist
Cirrostratus
Joined September 08, 2005
Thomas_Schaefer
Jun 03, 2016Nimbostratus
I'm trying to understand how this works. When a subsequent redirect is issued after the first redirect is that when the error occurs? Or does the error happen at the end? I use multiple iRules in a modular fashion and I have to put code in the top of every iRule to detect if a redirect or respond has already happened. The issue is that every time we do a respond or redirect, we also have to remember to set a variable called gRespondOrRedirect.
Maybe this is a different case, but I do not see how this would prevent a downstream iRule from doing the second respond or redirect and causing the TCL error.
I still believe the core issue is that all iRule processing for a given event does not stop when one does a respond or redirect. A HTTP::respond 302 noserver -abort Location "..." would be helpful.