Forum Discussion
mghosh_170954
Nimbostratus
Sep 19, 2014iRule POST data manipulation truncates the message
I have an iRule where I am intercepting an incoming HTTP POST request.
Then matching a portion of the request in the input stream, manipulating it and then sending it on.
However, I noticed tha...
mghosh_170954
Nimbostratus
Sep 19, 2014Here's the iRule:
when HTTP_REQUEST {
log local0. "URI: [HTTP::uri] - IP: [IP::client_addr] - Method: [HTTP::method]"
STREAM::disable
if { ( [HTTP::method] equals "POST" ) && ( [HTTP::uri] equals "/Process/POST" ) } {
log local0. "URI: [HTTP::uri] - IP: [IP::client_addr]"
STREAM::expression "@TestState.*@@"
STREAM::enable
}
}
when STREAM_MATCHED {
set url_string [STREAM::match]
log local0. "Input String: $url_string"
regexp {(TestState=)(.*)(&.*)} $url_string -> first url last
regsub -all {%25} $url % new_url
set replacement_string "${first}${new_url}${last}"
log local0. "Output String: $replacement_string"
STREAM::replace $replacement_string
}
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