diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java index 7877feb521..341d870d18 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java @@ -252,4 +252,27 @@ public class QueryStringDecoderTest { Assert.assertFalse(entries.hasNext()); } + + // See https://github.com/netty/netty/issues/1833 + @Test + public void testURI2() { + URI uri = URI.create("http://foo.com/images;num=10?query=name;value=123"); + QueryStringDecoder decoder = new QueryStringDecoder(uri); + Assert.assertEquals("/images;num=10", decoder.path()); + Map> params = decoder.parameters(); + Assert.assertEquals(2, params.size()); + Iterator>> entries = params.entrySet().iterator(); + + Entry> entry = entries.next(); + Assert.assertEquals("query", entry.getKey()); + Assert.assertEquals(1, entry.getValue().size()); + Assert.assertEquals("name", entry.getValue().get(0)); + + entry = entries.next(); + Assert.assertEquals("value", entry.getKey()); + Assert.assertEquals(1, entry.getValue().size()); + Assert.assertEquals("123", entry.getValue().get(0)); + + Assert.assertFalse(entries.hasNext()); + } }