Forum Discussion
oguzy
Mar 15, 2018Cirrostratus
Hi SK74,
class match filter should be in brackets like this.
when HTTP_RESPONSE {
if { ( [HTTP::header exists Location] ) and ( [HTTP::header Location] contains "http://" ) and ( [ class match [HTTP::header Location] contains ssl-domain-data-group ] ) } {
HTTP::header replace [string map -nocase {"http://" "https://"} [HTTP::header Location]]
}
}
Also you can try the below one:
when HTTP_RESPONSE {
if { [HTTP::header exists Location] } {
set location_info [HTTP::header Location]
if { ( $location_info contains "http://" ) and ( [class match $location_info contains ssl-domain-data-group ] ) } {
HTTP::header replace [string map -nocase {"http://" "https://"} $location_info]]
}
}
}
- SK74_347537Mar 23, 2018Nimbostratus
Problem solved! Thanks for the help, really appreciate it. Need to add "Location" before replace to correctly modify the HTTP header.
when HTTP_RESPONSE { if { ( [HTTP::header exists Location] ) and ( [HTTP::header Location] contains "http://" ) and ( [ class match [HTTP::header Location] contains ssl-domain-data-group ] ) } { HTTP::header Location replace [string map -nocase {"http://" "https://"} [HTTP::header Location]] } }