Closed mararn1618 closed 3 years ago
Can you provide some RFC or similar to ensure that white spaces are allowed in URL paths?
Of course: https://tools.ietf.org/html/rfc3986#section-2.1 states that URIs may include percentage espaped characters and uses %20
as an example.
Just want to point out that I have added another Interceptor on top. I can verify that in my case the URI has %20
-encoding before reaching com.github.mkopylec.charon.forwarding.interceptors.HttpRequestInterceptor
.
Is it decoded and passed to UriComponentsBuilder
?
CommonRegexRequestPathRewriter
decodes the URL with URI.getPath()
and I assume characters are not encoded again.
Edit:
The URI rewrittenURI
needs to be built differently. The rewrittenPath
(flawed according to RFC, since it allows illegal characters after being decoded before). We need to encode before or build differently.
Hope my debugging helps.
Fixed in 4.9.0
Excited - Can't wait to test, hope I get the chance in the next days.
Works like a charm. Thank you.
Great!
I am using Charon to forward and rewrite some requests, in particular I use
For URIs such as
/quickbrain/merge/PROJECT_CODE/EVIL%20BLANK
, I'm getting an exception. When I remove the encoded blank (%20) everything is fine.The exception I get is about a decoded blank ' ' (not %20):
When checking the request before it reaches
com.github.mkopylec.charon.forwarding.interceptors.HttpRequestInterceptor
I can see that the blank ist still encoded (still '%20' and not ' ').My Charon code:
The full exception:
I believe blanks in URIs should be supported. Can you help?