Forum Discussion

jwlarger's avatar
jwlarger
Icon for Cirrus rankCirrus
Nov 06, 2019

iRule to replace { - } with %7B - %7D

I need to parse incoming headers and selectively replace { or } with %7B or %7D. (v11.6.3)   Something like ? when HTTP_REQUEST {   if { [HTTP::uri] starts_with "/someuri/" } {     HTTP::uri...
  • cjunior's avatar
    Nov 06, 2019

    Hi,

    You must escape this with back slash.

    HTTP::uri [string map {\{ %7B \} %7D} [HTTP::uri]]
     
    OR
     
    HTTP::uri [string map {\x7B %7B \x7D %7D} [HTTP::uri]]

    I hope it helps.

    Regards.