Forum Discussion

kohli9harjeev's avatar
kohli9harjeev
Icon for Nimbostratus rankNimbostratus
Dec 15, 2015

LTM logs filled with err tmm1[11650]: 01220001:3: TCL error: /Common/HttpOnly_Secure_irule <http_response> - Operation not supported (line 1)

Hi All,

 

I implemented the following irule to include "HttpOnly" and "Secure" attribute in HTTP response .Though it is working fine TP response but it is showing lot of errors on the ltm logs

 

Irule: when HTTP_RESPONSE { set cookie_value [HTTP::header values "Set-Cookie"] if { $cookie_value ne ""}{ HTTP::header remove "Set-Cookie"

 

foreach set_cookie_header $cookie_value { HTTP::header insert "Set-Cookie" "${set_cookie_header};Secure;HttpOnly" } } else {return} }

 

Error: err tmm1[11650]: 01220001:3: TCL error: /Common/HttpOnly_Secure_irule - Operation not supported (line 1) invoked from within "HTTP::header remove "Set-Cookie"" err tmm1[11650]: 01220001:3: TCL error: /Common/HttpOnly_Secure_irule - Operation not supported (line 1) invoked from within "HTTP::header remove "Set-Cookie"" err tmm1[11650]: 01220001:3: TCL error: /Common/HttpOnly_Secure_irule - Operation not supported (line 1) invoked from within "HTTP::header remove "Set-Cookie""

 

We have recently upgraded to 11.6HF6. Can someone help me in this.

 

1 Reply

  • Hi kohli9harjeev,

     

    your code looks good to me.

     

    The error message will most likely occour if the current HTTP-request was "somehow" already responded by previous iRules. To check this behavior you could modify your code to...

     

    when HTTP_RESPONSE { 
        set cookie_value [HTTP::header values "Set-Cookie"] 
        if { $cookie_value ne ""} then {
            if { [catch {HTTP::payload replace 0 0 {}}] } then {
                log -noname local0. "Warning: The HTTP request is already responded. So the next command will create an exception!" 
            }
            HTTP::header remove "Set-Cookie"
            foreach set_cookie_header $cookie_value { 
                HTTP::header insert "Set-Cookie" "${set_cookie_header};Secure;HttpOnly" 
            }
        }
    }

    Cheers, Kai