Forum Discussion
David_Sherman_2
Nimbostratus
Oct 31, 2006Header sanitize
The following IRule was working.
when HTTP_REQUEST {
set OrgAdr [IP::remote_addr]:[TCP::remote_port]
set DestServer [IP::local_addr]
HTTP::header sanitize Host + Content-Type + Content-Length + Authorization
HTTP::header insert Server $DestServer
HTTP::header insert OriginalClientAddress $OrgAdr
}
After modifying a different IRule it stopped working and I get the error listed below
TCL error: Rule Tandem_Filter_URI_Header - Operation not supported (line 4) invoked from within "HTTP::header sanitize Host + Content-Type + Content-Length + Authorization"
Is it the - (dash) in the Content-Type header that is the problem?
3 Replies
- Colin_Walker_12Historic F5 AccountAll you should need is a single string argument to the sanitize command.
when HTTP_REQUEST { set OrgAdr [IP::remote_addr]:[TCP::remote_port] set DestServer [IP::local_addr] HTTP::header sanitize "Host Content-Type Content-Length Authorization" HTTP::header insert Server $DestServer HTTP::header insert OriginalClientAddress $OrgAdr }
- Chris_Hallenbec
Nimbostratus
Along the lines of this question, I have a problem I am trying to solve. "HTTP::header remove" and "HTTP::header replace" appear to only be designed to remove the last occurrence of a given header, but a malicious person could pass multiple of the same header to thwart the removal/replacement. - Deb_Allen_18Historic F5 AccountOne of my customers is using code like this to remove /replace inbound headers (not tested by me personally, but I believe they have verified that it removes multiple instances of the same header):
HTHwhen HTTP_REQUEST { strip all instances of existing headers foreach header {Header1 Header2 Header3} { while { [HTTP::header exists $header] } { HTTP::header remove $header } } HTTP::header insert Header1 Value }
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