From 2243970294565ebe2c045345f9a06be0973ab94a Mon Sep 17 00:00:00 2001 From: Phillip Schichtel Date: Thu, 12 Sep 2013 14:09:41 +0200 Subject: [PATCH] [#1833] Replace ; with & only in the QueryString and not the whole URI --- .../netty/handler/codec/http/QueryStringDecoder.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java index 792452f44e..4075efa25b 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java @@ -113,8 +113,7 @@ public class QueryStringDecoder { "maxParams: " + maxParams + " (expected: a positive integer)"); } - // http://en.wikipedia.org/wiki/Query_string - this.uri = uri.replace(';', '&'); + this.uri = uri; this.charset = charset; this.maxParams = maxParams; this.hasPath = hasPath; @@ -160,10 +159,8 @@ public class QueryStringDecoder { hasPath = false; } // Also take care of cut of things like "http://localhost" - String newUri = rawPath + '?' + uri.getRawQuery(); + this.uri = rawPath + '?' + uri.getRawQuery(); - // http://en.wikipedia.org/wiki/Query_string - this.uri = newUri.replace(';', '&'); this.charset = charset; this.maxParams = maxParams; } @@ -222,7 +219,8 @@ public class QueryStringDecoder { name = decodeComponent(s.substring(pos, i), charset); } pos = i + 1; - } else if (c == '&') { + // http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2 + } else if (c == '&' || c == ';') { if (name == null && pos != i) { // We haven't seen an `=' so far but moved forward. // Must be a param of the form '&a&' so add it with