Forum Discussion

Anthony's avatar
Anthony
Icon for Nimbostratus rankNimbostratus
Jan 18, 2017

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

  • 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.

     

  • 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
    return
    

    This will stop any further iRule events running and exit the current iRule.

  • 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
    return
    

    1) 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