regsub
2 TopicsiRules uses regsub to do URL conversions
I'd like to automatically convert URLs, i.e "https://sc-uat.ct.example.com/sc/" into "https://invbeta.example.com/sc/" "https://sc-dev.ct.example.com/sc/" into "https://invtest.example.com/sc/" "https://sc-qa.ct.example.com/sc/" into "https://invdemo.example.com/sc/" I've tried following code snippet in TCL set loc "https://sc-uat.ct.example.com/sc/" set envs(dev) "test" set envs(uat) "beta" set envs(qa) "demo" puts $envs(uat) regsub -nocase {://.+-(.+).ct.example.com} $loc {://inv[$envs(\1)].example.com} hostname puts "new location = $hostname" But the result is:new location =https://inv[$envs(uat)].example.com/sc/It seems that[$envs(uat)]is NOT eval-ed further. Any hints will be appreciated. Thanks in advance829Views0likes1CommentModifying http response on iRule corrupts scandinavian characters, how to prevent?
One of our backend applications is returning incorrect hostname for some references on content which leads to timeouts and several minute loadtimes. We've tried to correct the issue by replacing the incorrect hostnames on response data, which works fine except that it corrupts all the scandinavian characters on content. For example the response contents change like this: - "kiinteistönvälitys" becomes "kiinteistönvÀlitys" - "Säästä ja sijoita" becomes "SÀÀstÀ ja sijoita" It seems like any modification to payload corrupts the special characters. If we just take the payload into a variable and do a replace, characters are ok but any change to payload corrupts all the special characters. We've tried following methods on altering the payload, but none of them works properly: - STREAM::expression - STREAM::replace - regsub Any ideas how to get the content replacement done correctly?396Views0likes5Comments