Forum Discussion
JRahm
Sep 06, 2013Admin
Try something like this:
when HTTP_RESPONSE {
STREAM::disable
set strexp ""
if { [HTTP::header Content-Type] matches_glob "text/*ml" } {
append strexp "@http://user.example.net/images@@"
append strexp "@http://user.example.net/port@@"
}
if { $strexp ne "" } {
STREAM::expression $strexp
STREAM::enable
}
if { [HTTP::header exists "Location"] } {
if { [HTTP::header "Location"] starts_with "http://" } {
HTTP::replace "Location" [string map "http:// https://" [HTTP::header "Location"]]
}
}
}
when STREAM_MATCHED {
switch -glob [string tolower [STREAM::match]] {
"http://user.example.net/images" { STREAM::replace "https://user.example.net/images" }
"http://user.example.net/port" { STREAM::replace "https://user.example.net/port" }
}
}