Just remove the dash in front of list:
[string map -nocase [list $find $replace] [HTTP::header value Location]
Also note that the "$" should not be present on the two set commands. In TCL shell:
% set find "http://www.foo.com/abc"
http://www.foo.com/abc
% set replace "https://www.foo.com/abc"
https://www.foo.com/abc
% set location "Location: http://www.foo.com/abc/home.html"
Location: http://www.foo.com/abc/home.html
% string map [list $find $replace] $location
Location: https://www.foo.com/abc/home.html
Note that setting the variables not only takes up unnecessary cpu/memory, but it also requires the list command in the string map, which takes extra cpu cyles. Would be better just to define them unless there are multiple potential matches. This would be shortened to:
when HTTP_RESPONSE {
if {[HTTP::is_redirect] and [HTTP::header value Location] contains "?targetURL=http://www.foo.com/abc"} {
HTTP::header replace Location [string map -nocase {"http://www.foo.com/abc" "https://www.foo.com/abc"} [HTTP::header value Location]]
}
}
HTH...Jason