24-Jun-2020 14:59
Hi,
I have an iRule for below URL redirection.
when HTTP_REQUEST {
if { ([HTTP::host] eq "abc.com") && ([string tolower [HTTP::uri]] starts_with "/iauth") } {
HTTP::redirect https://xyz.com[HTTP::uri]
}
}
When the POST method is used to redirect , it fails and forwards the traffic on GET - is there a way to keep the header as is?
Works fine when GET method is used.
24-Jun-2020 18:24
You will need to clarify, do you mean this?
25-Jun-2020 05:44
The GET and POST method directly to redirected URL https://xyz.com/* works perfectly ok.
And GET method to actual URL https://abc.com/* , redirects perfectly to https://xyz.com/* with no header content being missed.
only problem is with POST method where the actual URL's https://abc.com/* redirection is working but the header content is being missed - not giving the expected results.
26-Jun-2020 09:20
Try with HTTP::respond 307 for the POST and 302 for the GET
if { [string tolower [HTTP::method]] eq "post" } {
HTTP::respond 307 Location "https://test.example.com" }
Hints:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302