Forum Discussion
Operation not supported (line 5) invoked from within "HTTP::header insert
I think what you need to do is make sure that the redirect happens after setting the header. If that's not possible, on your redirect you could do something like this instead
HTTP::respond 301 Location "url here" "Connection" "Close"
event disable all
This would keep any further iRules from executing. As I understand, the reason you would get this message is because you've already started a response to the client, so the request will not be going to the backend server, and shouldn't be modified anymore.
Another option would be to set a flag if you've done a redirect and then check the flag in other irules and skip them if you have set a redirect, but to me, that's kinda inefficient, which is why I use the event disable command and send the close connection header (the event disable stays that way for the connection lifetime). And when you do an HTTP::respond or HTTP::redirect, you don't get the HTTP_RESPONSE event fired, so you can't reenable the events.
Hope this helps.
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