Forum Discussion
JosephT
Nimbostratus
Oct 24, 2008Help write an irule to check and strip transfer-encoding header
We have a need to inspect all http requests and, if an HTTP request contains a Transfer-Encoding header with a value greater than 64 bytes, then we want to remove the Transfer-Encoding header from the HTTP request
I came up with this:
when HTTP_REQUEST {
if { [HTTP::header exists "Transfer-Encoding"] && [HTTP::header "Transfer-Encoding"] > 64 } {
[HTTP::header remove Transfer-Encoding]
}
}
But it doesn't appear to be working correctly. When testing, if the HTTP request contains a Transfer-Encoding header (of any size), the HTTP request just never makes it through.
Any help would be greatly appreciated. TIA!
- hoolio
Cirrostratus
Hi there,when HTTP_REQUEST { if { [HTTP::header exists "Transfer-Encoding"] && [string length [HTTP::header "Transfer-Encoding"]] > 64 } { HTTP::header remove Transfer-Encoding } }
- JosephT
Nimbostratus
Aaron. Your irule worked perfectly! Thanks for explaining the use of string length and the braces!!!
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects