Forum Discussion
Darren_Young_10
Nimbostratus
Mar 11, 2010Remove headers on GET vs. POST
How could I remove headers on a GET vs. a POST request?
hoolio
Cirrostratus
Mar 12, 2010You can check the port in HTTP_RESPONSE using TCP::server_port:
when HTTP_REQUEST {
set remove_headers 0
Check the requested path
switch -glob [HTTP::path] {
"/path1/*" -
"*/path2/" -
"*/path3/*" {
if {[HTTP::method] eq "POST"}{
set remove_headers 1
}
}
}
}
when HTTP_RESPONSE {
if {$remove_headers && [TCP::server_port] != 443}{
HTTP::header remove Cache-Control
HTTP::header remove Pragma
}
}
You can use PROFILE::exists serverssl to check for a server SSL profile on the VIP, but I think this is a more expensive operation than checking the TCP port.
Aaron
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