Forum Discussion
GBurch
Dec 05, 2018Altostratus
iRule Encode special charaters in URI String
I have an iRule, which is capturing the current URI, and appending it as a variable onto another URL string later on.
when HTTP_REQUEST {
...
...
set host [HTTP::host]
set uri [HTTP::uri]
set url "http://internal-address.local.lan/index.html?aup-key=$aupkey&$schema&$host&$uri"
}
However, if the original URI contains an ampersand itself, it's truncating it at that character so that the full original URI never gets passed on.
I'm not overly familiar with TCL, is there an easy way I could encode the uri variable in my code above so that it includes all special characters as well?
Many thanks
- Stanislas_Piro2Cumulonimbus
You may use
set encoded_uri [URI::encode [HTTP::uri]
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