fix UrlQuery

This commit is contained in:
Looly
2021-11-07 03:23:44 +08:00
parent a5adc9ae94
commit 941e4f39ca
5 changed files with 76 additions and 19 deletions

View File

@@ -108,6 +108,14 @@ public class UrlQueryTest {
Assert.assertEquals("a+b=1+2", a);
}
@Test
public void parsePlusTest(){
// 根据RFC3986在URL中+是安全字符,即此符号不转义
final String a = UrlQuery.of("a+b=1+2", CharsetUtil.CHARSET_UTF_8)
.build(CharsetUtil.CHARSET_UTF_8);
Assert.assertEquals("a+b=1+2", a);
}
@Test
public void spaceTest(){
// 根据RFC3986在URL中空格编码为"%20"