Forum Discussion
HELP!!!!! http to https redirect lost SOAP envelops
when i do http to https redirect it loses its SOAP information.
http://abc.com to https://abc.com
If i directly go to https://abc.com or http://abc.com it works perfectly fine. but when i remove my http policy and use the redirect below it loses it's SOAP information.
iRule used.
when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] }
Thank you all in advance....
2 Replies
Hello,
Unfortunately, it's not possible using only http protocol. You can inspire the irule I get from Nitass in a previous POST. You can workaround the http limitation by injecting a javascript that force the browser to re-post the content :
when HTTP_REQUEST { if { ([string tolower [HTTP::host]]) contains "unitynet.mysite.com" } { switch -glob -- [string tolower [HTTP::uri]] { "*akcelerantws.asmx*" { set ext_url "https://webservices.mysite.com/Unity/Akcelerantws.asmx" } "*credispherewsv2.asmx*" { set ext_url "http://webservices.mysite.com/Unity/CrediSphereWSV2.asmx" } "*interfaceservice.asmx*" { set ext_url "https://webservices.mysite.com/Unity/InterfaceService.asmx" } "*meridianlinkws.asmx*" { set ext_url "https://webservices.mysite.com/Unity[HTTP::uri]" } "*unitysailws.asmx*" { set ext_url "https://webservices.mysite.com/Unity/UnitySAILWS.asmx" } "*unityweblet.asmx*" { set ext_url "https://webservices.mysite.com/Unity/UnityWeblet.asmx" } "*weblet.asmx*" { set ext_url "https://webservices.mysite.com/Unity/UnityWeblet.asmx" } default { return } } } else { return } if { [string tolower [HTTP::method]] eq "get" } { HTTP::redirect $ext_url } elseif { [string tolower [HTTP::method]] eq "post" } { if { [HTTP::header exists "Content-Length"] } { if { [HTTP::header "Content-Length"] > 1048000 }{ set content_length 1048000 } else { set content_length [HTTP::header "Content-Length"] } } else { set content_length 1048000 } if { $content_length > 0 } { HTTP::collect $content_length } } else { do something } } when HTTP_REQUEST_DATA { set content "< script type=text/javascript language=javascript> \ function s(){ document.f.submit(); } \ " foreach p [split [HTTP::payload] &] { set name [URI::decode [getfield $p = 1]] set value [URI::decode [getfield $p = 2]] set content "${content}" } set content "${content}" HTTP::respond 200 content $content } }initial post can be read here : https://devcentral.f5.com/questions/redirects-with-get-post
- Stanislas_Piro2
Cumulonimbus
Hi,
the problem is when response is 302 redirect, client will request GET method instead of requesting with the same method and content.
with 307 redirect, the client will resend the same request as the first one:
try this irule:
when HTTP_REQUEST { if {([HTTP::method] equals "POST") && ([HTTP::header Content-Type] contains "application/xml")} { HTTP::respond 307 noserver Location https://[getfield [HTTP::host] ":" 1][HTTP::uri] } else { HTTP::respond 302 noserver Location https://[getfield [HTTP::host] ":" 1][HTTP::uri] } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com