This commit is contained in:
Ngoc Dao 2011-11-23 04:14:10 +09:00
parent 3ecb93eade
commit c9a24729bd

View File

@ -30,9 +30,11 @@ import org.jboss.netty.util.CharsetUtil;
* Splits an HTTP query string into a path string and key-value parameter pairs.
* This decoder is for one time use only. Create a new instance for each URI:
* <pre>
* {@link QueryStringDecoder} decoder = new {@link QueryStringDecoder}("/hello?recipient=world");
* {@link QueryStringDecoder} decoder = new {@link QueryStringDecoder}("/hello?recipient=world&x=1;y=2");
* assert decoder.getPath().equals("/hello");
* assert decoder.getParameters().get("recipient").equals("world");
* assert decoder.getParameters().get("x").equals("1");
* assert decoder.getParameters().get("y").equals("2");
* </pre>
*
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
@ -73,7 +75,8 @@ public class QueryStringDecoder {
throw new NullPointerException("charset");
}
this.uri = uri;
// http://en.wikipedia.org/wiki/Query_string
this.uri = uri.replace(';', '&');
this.charset = charset;
}
@ -97,7 +100,8 @@ public class QueryStringDecoder {
throw new NullPointerException("charset");
}
this.uri = uri.toASCIIString();
// http://en.wikipedia.org/wiki/Query_string
this.uri = uri.toASCIIString().replace(';', '&');
this.charset = charset;
}