QueryStringDecoder does not decode correctly path part with '+' (plus) sign in it
See original GitHub issueExpected behavior
‘+’ is a valid char for path part of URI, it should not be replaced by space.
Actual behavior
‘+’ is replaced with space.
Steps to reproduce
Minimal yet complete reproducer code (or URL to code)
public void testURIPathDecoding() throws URISyntaxException {
String path = "/a/path/with/a+in.it";
URI uri = new URI("http", "www.bbbb.com", path, null);
System.out.println(path.equals(uri.getPath()));
System.out.println(path.equals(uri.getRawPath()));
QueryStringDecoder dec = new QueryStringDecoder(uri.getRawPath());
System.out.println(dec.path());
System.out.println(path.equals(dec.path()));
System.out.println(path.equals(dec.uri()));
}
true
true
/a/path/with/a in.it
false
true
Netty version
4.1.11
JVM version (e.g. java -version
)
OS version (e.g. uname -a
)
Any
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
QueryStringDecoder (Netty API Reference (4.1.85.Final))
Splits an HTTP query string into a path string and key-value parameter pairs. This decoder is for one time use only. Create a...
Read more >File.toURI does not encode plus sign - java - Stack Overflow
It treat the '+' plus as encoded character and hence decode it to ... toURI does not encode + sign in path part...
Read more >Stardog Platform Release Notes | Stardog Documentation 7.8.3
Multiline queries passed to CLI explain are now correctly parsed. Inconsistent usage of base URI used for parsing when one is not specified...
Read more >playframework/playframework - Gitter
https://netty.io/4.0/api/io/netty/handler/codec/http/QueryStringDecoder.html. lemme look ... Is there any way to get the request time from a play.api.mvc.
Read more >Guide to Java URL Encoding/Decoding - Baeldung
For example, a “+” sign is a valid character in path segments and therefore should not be encoded. To encode the path segment,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found one more problem: a charset does not work as intended… Code
return
I’ll try to fix this too.
fixed by https://github.com/netty/netty/pull/6781