For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

zski128_101720's avatar
zski128_101720
Icon for Nimbostratus rankNimbostratus
Nov 03, 2015

Escape 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