Forum Discussion
Yozzer
Dec 13, 2010Nimbostratus
Search payload and redirect to payload value
Hi
I need some help with the irule below. I want to search for a POST data name 'Relay" and then check its value and then redirect the POST to the Relay value . Relay could have a few diff...
Yozzer
Dec 14, 2010Nimbostratus
I found this from a previous post and added your recommendations but found it doesnt save the rule on the BIGIP or give me feedback on its syntax. Also when posting the last part renders html which i took from the "Redirect POST data while load balancing GET iRule" http://devcentral-sea.f5.com/Forums/tabid/1082223/asg/50/showtab/groupforums/aff/5/aft/1172096/afv/topic/Default.aspx :
when HTTP_REQUEST {
if {([HTTP::method] eq "POST") && ([HTTP::uri] eq "/test")} {
HTTP::collect [HTTP::header "Content-Length"]
}
}
when HTTP_REQUEST_DATA {
switch -glob [URI::decode [URI::query "?[HTTP::payload]" Relay]] {
"*/test2/*" {
set static::ext_url "https://test.com/test2/login.aspx"
}
"*/test3/*" {
set static::ext_url "https://test.com/test3/login.aspx"
}
set content " \
<form>>> name=f action='$static::ext_url' method=post>"
foreach p [split [HTTP::payload] &] {
set name [getfield $p = 1] set value [decode_uri [getfield $p = 2]]
set content "${content}" }
set content "${content}</form>"
HTTP::respond 200 content $content
}
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