Forum Discussion
Jonesey3000
Jun 16, 2021Nimbostratus
iRULE regsub error
Hi Smart People I am having some problems with an iRule that has been created on our F5 as a work around to a mixed content error we are receiving on a web page. Our page uses HTTPS but there is...
- Jun 16, 2021
To match a literal } in a string, you will need to escape it
"\}\}\}\}"
Jonesey3000
Nimbostratus
Thank you Simon. That did the trick.
Simon_Blakely
Jun 17, 2021Employee
For an easier irule, try something like
regsub {http:\/\/(.*):80} [HTTP::payload] {https://\1} fixeddata
% puts $payload
\{\"result\":\{pathTo3DJSON\":\"http://genericsite.com:80/extrainfo/somefile.extension\"\}\}
% regsub {http:\/\/(.*):80} $payload {https://\1} fixeddata
% puts $fixeddata
\{\"result\":\{pathTo3DJSON\":\"https://genericsite.com/extrainfo/somefile.extension\"\}\}
The regsub matches the whole string starting with http and ending with :80
It also creates a matching group of the fqdn between :// and :80.
You then substitute https://<first matching group> into the result.
Much more efficient.
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