Forum Discussion
HTTP::uri decodes encoded chars by default, and I don't see an option to stop it
I am doing simple HTTP to HTTPS redirects, I can't use a policy and need to use an iRule to do this.
My problem is some of the URI's contain encoded chars - in particular an encoded /. When I then use HTTP:uri to pass the URI to the redirect (in fact if I evaluate HTTP::uri in any way) the encoded chars have been decoded :( and in the case of the %2F which is the most common one this breaks things.
I did consider encoding the particular section of the URI that this char appears in but it's not predictable :(:(
I did ask the developer if they could stop encoding and translate to another legal char but it seems the framework they are using (Angular2) may be doing it rather than our code.
Anyone know how to either stop the chars being decoded or another way around this ?
Thanks Jason
- Vijay_E
Cirrus
Have you explored URI::encode and did it not help, if you have tried it ?
- JG
Cumulonimbus
Use
instead.HTTP::request
- Stanislas_Piro2
Cumulonimbus
Hi,
I don't understand what is the issue.
I tested your URI with the default
irule which redirect http to https and here is the result:_sys_https_redirect
$ curl http://company.local/0%2F101%2F0%2F1/621be240-355e-4f75-b96a-e4116d195fd4 -vv * Trying 1.1.1.1... * Connected to company.local (1.1.1.1) port 80 (0) > GET /0%2F101%2F0%2F1/621be240-355e-4f75-b96a-e4116d195fd4 HTTP/1.1 > Host: company.local > User-Agent: curl/7.43.0 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 302 Found < Location: https://company.local/0%2F101%2F0%2F1/621be240-355e-4f75-b96a-e4116d195fd4 < Server: BigIP * HTTP/1.0 connection set to keep alive! < Connection: Keep-Alive < Content-Length: 0 < * Connection 0 to host company.local left intact
The redirect keep all encoded characters and did not decode them.
Recent Discussions
Related Content
* 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