Forum Discussion
zski128_101720
Nimbostratus
Nov 03, 2015Escape special characters in variable?
I have an iRule that redirects an HTTP post request. However the payload can contain special characters that cause the payload to be truncated or the redirect to fail. Is there a way to parse the variable contents and escape or drop the characters?
Code snippet:
http::collect happens above
when HTTP_REQUEST_DATA {
log local0. "IP:[IP::client_addr] test setting REQUST_DATA host is $host"
set content " \
"
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}"
set content "${content}"
HTTP::respond 200 content $content
}No RepliesBe the first to reply
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