Forum Discussion
cylinh_171509
Altocumulus
May 02, 2016HELP!!!!! 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 ...
Yann_Desmarest
Cirrus
May 02, 2016Hello,
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects