Forum Discussion
jim_sellers_436
Oct 13, 2010Nimbostratus
Irule help - encoding
Hello all below is the issue to I am having and the irule we tossed together. I am trying understand if this is a possible bug with BIG-IP 9.3.1 Build 69.0. I’ve attached the log output fro...
hooleylist
Oct 19, 2010Cirrostratus
URI::encode seems to work correctly on 9.3.1 and 10.2.0:
when RULE_INIT {
log local0. "[URI::encode http://test.example.com]"
}
Rule : http%3a%2f%2ftest.example.com
I'm not sure what the issue is with the existing rule as I didn't step through it. But I think you can avoid some of the operations using inbuilt the URI::query and URI::encode functions:
http://devcentral.f5.com/wiki/default.aspx/iRules/uri
when RULE_INIT {
This event is here just to show the intermediate values for the URI parsing
set url_orig "http://federation.stage.gecompany.com/jsp/redirectWebEx.jsp?TARGET=https://emeetings-test2.webex.com/emeetings-test2/j.php?ED=141224332UID=1011455307PW=NODBlNzAxNjE2RT=MiMxMQ3D3D"
log local0. "\$url_orig: $url_orig"
set target [URI::query $url_orig "TARGET"]
log local0. "\$target: $target"
set target_encoded [URI::encode [URI::query $url_orig "TARGET"]]
log local0. "\$target_encoded: $target_encoded"
set target_redirect "https://fss.stage.gecompany.com/fss/idp/startSSO.ping?PartnerSpId=webex.com&ACSIdx=2&TARGET=[URI::encode [URI::query $url_orig "TARGET"]]"
log local0. "\$target_redirect: $target_redirect"
}
when HTTP_REQUEST {
Check if we need to rewrite this request?
if {$some_condition == 1}{
HTTP::redirect "https://fss.stage.gecompany.com/fss/idp/startSSO.ping?PartnerSpId=webex.com&ACSIdx=2&TARGET=[URI::encode [URI::query [HTTP::uri] "TARGET"]]"
}
}
/var/log/ltm output from the test code in RULE_INIT:
< RULE_INIT>: $url_orig: http://federation.stage.gecompany.com/jsp/redirectWebEx.jsp?TARGET=https://emeetings-test2.webex.com/emeetings-test2/j.php?ED=141224332UID=1011455307PW=NODBlNzAxNjE2RT=MiMxMQ3D3D
< RULE_INIT>: $target: https://emeetings-test2.webex.com/emeetings-test2/j.php?ED=141224332UID=1011455307PW=NODBlNzAxNjE2RT=MiMxMQ3D3D
< RULE_INIT>: $target_encoded: https%3a%2f%2femeetings-test2.webex.com%2femeetings-test2%2fj.php%3fED%3d141224332UID%3d1011455307PW%3dNODBlNzAxNjE2RT%3dMiMxMQ3D3D
< RULE_INIT>: $target_redirect: https://fss.stage.gecompany.com/fss/idp/startSSO.ping?PartnerSpId=webex.com&ACSIdx=2&TARGET=https%3a%2f%2femeetings-test2.webex.com%2femeetings-test2%2fj.php%3fED%3d141224332UID%3d1011455307PW%3dNODBlNzAxNjE2RT%3dMiMxMQ3D3D
Aaron
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