Good point. I must have been distracted by the phone.
What I should have posted is this:
when HTTP_REQUEST {
set host [HTTP::host];
log LOCAL0.debug "URI=$host";
}
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" } {
set location [HTTP::header "Location"];
if { $location starts_with "http://" } {
set temp [substr $location 7];
if { $host equals [substr $temp 0 "/"] }{
HTTP::header replace "Location" "https://$temp";
}
}
}
}
Will [substr $temp 0 "/"] return the trailing "/"? If so, can anyone suggest an efficient way of dropping it?
Sorry to ask such simple, testable, questions. Unfortunately I don't have a test environment and will only have a short testing window when I put this in production.