Hello, guys. I’m trying to find a way to perform manipulation with HTTP::header Location.
1. Web-browser requests https://abc.com
2. Web-server replies with HTTP/301 Location: https://xyz.com/{$URI} (URI part might change when browsing)
3. I need to have HTTP::Location modified to https://abc.com/{$URI} (whatever was put in 2)
I was trying to achieve this with getfield with “/” as delimiter to catch URI part, but this gets broken as number of slashes in Location might increase
when HTTP_REQUEST {
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
if {([HTTP::is_redirect]) && ([HTTP::header Location] contains "xyz.com" )} {
HTTP::header replace Location "https://abc.com$uri"
}
}