drumik_61546
Oct 14, 2009Nimbostratus
Removing Headers from IIS
Weird issue. The script work some times, some times it doesn't.
Sometimes it's removing all the headers, sometimes it does what it suppose to do
Any ideas? I
m runing 9.4.6
when RULE_INIT {
Create a list of the response headers to preserve. This needs to be tailored to the application!
set ::headers_to_preserve [list \
Accept-Ranges\
Cache-Control\
Connection\
Content-Disposition\
Content-Encoding\
Content-Length\
Content-Type\
Date\
ETag\
Last-Modified\
Pragma\
Set-Cookie\
Location\
X-PvInfo\
Vary\
Transfer-Encoding\
Expires\
]
Log debug messages to /var/log/iisheader? 1=yes, 0=no.
set ::clocking_debug 1
}
when HTTP_RESPONSE {
Remove all headers but those in the preserve list
foreach aHeader [HTTP::header names] {
if {not ([matchclass $::headers_to_preserve equals $aHeader])}{
while {[HTTP::header exists $aHeader]}{
if {$::clocking_debug}{log local0. "Removing: $aHeader: [HTTP::header value $aHeader]"}
HTTP::header remove $aHeader
}
}
}
}