Forum Discussion
Header removal causing TCL error
I've looked at a few threads relating to this but still not found a solution to my problem.
I have a number of iRules on a VS, and I am getting connection reset errors.
Log message:
TCL error: (rule_name) - Operation not supported (line 😎 invoked from within "HTTP::header remove Accept-Encoding"
One iRule is resulting in a redirect, the other which is causing the error is attempting to remove the header mentioned above, to enable some stream profile work.
Am I missing something glaringly obvious here?
Any advice would be greatly recieved!
Many thanks,
Anthony
3 Replies
- Stanislas_Piro2
Cumulonimbus
Hi,
HTTP redirect does not prevent next irule execution.
If in one irule, there is a HTTP redirect, then next HTTP command to modify HTTP request are not supported.
- Martin_Robbins
Nimbostratus
Hello,
As you cannot modify the headers after a redirect has been sent, I suggest you add the following immediately after the initial HTTP::redirect (or a HTTP::respond)
event disable all returnThis will stop any further iRule events running and exit the current iRule.
- Jad_Tabbara__J1
Cirrostratus
Hello Anthony,
This will work for sure, I already had to manage this case...
Replace your "HTTP::Redirect" by
HTTP::respond 302 Location "[http://www.domain.org"](http://www.domain.org) "Connection" "Close" event disable return1) It is important to replace the redirect because it does not close the connection (by default KeepAlive...). Closing the connection will initiate a new TCP Handshake and for next request your irules event will be executed
2) The "event disable" will only disable the HTTP_REQUEST event
Hope that it will help
Regards
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
