netty: QueryStringDecoder does not decode correctly path part with '+' (plus) sign in it
Expected 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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (14 by maintainers)
Commits related to this issue
- Fixes in QueryStringDecoder Motivation: QueryStringDecoder has several problems: - doesn't decode correctly path part with `+` (plus) sign in it, - doesn't cut a `fragment` (after `#`) from query st... — committed to netty/netty by fenik17 7 years ago
- Fixes in QueryStringDecoder Motivation: QueryStringDecoder has several problems: - doesn't decode correctly path part with `+` (plus) sign in it, - doesn't cut a `fragment` (after `#`) from query st... — committed to netty/netty by fenik17 7 years ago
- Fixes in QueryStringDecoder Motivation: QueryStringDecoder has several problems: - doesn't decode correctly path part with `+` (plus) sign in it, - doesn't cut a `fragment` (after `#`) from query st... — committed to liuzhengyang/netty by fenik17 7 years ago
- Fixes in QueryStringDecoder Motivation: QueryStringDecoder has several problems: - doesn't decode correctly path part with `+` (plus) sign in it, - doesn't cut a `fragment` (after `#`) from query st... — committed to kiril-me/netty by fenik17 7 years ago
- Fixes in QueryStringDecoder Motivation: QueryStringDecoder has several problems: - doesn't decode correctly path part with `+` (plus) sign in it, - doesn't cut a `fragment` (after `#`) from query st... — committed to pulllock/netty by fenik17 7 years ago
Found one more problem: a charset does not work as intended… Code
return
I’ll try to fix this too.