Forum Discussion
Nick_T1
Feb 18, 2016Nimbostratus
Here is the sample rule that I came up with. Very similar to that which was posted by Kai. However, I modified the conditions slightly as we don't know that the headers will exist for every request, so instead I opted to loop through all headers by name and delete any that match a switch statement. I don't know why I didn't think to try the address as 10.0.0.0/8 or similar, as we already employ that in a class file for a similar purpose elsewhere. Thanks for the reminder and response.
when HTTP_REQUEST {
check for internal state
if {([class match [IP::client_addr] equals private_net])}{
set internal_client 1
} else {
set internal_client 0
}
}
when HTTP_RESPONSE {
if {!($internal_client)}{
foreach header_name [HTTP::header names] {
switch [string tolower $header_name] {
"badheader1" -
"itwasfordebugging" -
"whyohwhy" { HTTP::header remove $header_name }
}
}
}
}