=htc add ';' to to-be-encoded characters in URI.Query rendering
Port of https://github.com/spray/spray/pull/927
This commit is contained in:
parent
2f6499bcdf
commit
882f47ada8
1 changed files with 12 additions and 0 deletions
|
|
@ -302,6 +302,18 @@ class UriSpec extends WordSpec with Matchers {
|
|||
Query() shouldEqual Empty
|
||||
Query("k" -> "v") shouldEqual ("k" -> "v") +: Empty
|
||||
}
|
||||
"encode special separators in query parameter names" in {
|
||||
Query("a=b" -> "c").toString() === "a%3Db=c"
|
||||
Query("a&b" -> "c").toString() === "a%26b=c"
|
||||
Query("a+b" -> "c").toString() === "a%2Bb=c"
|
||||
Query("a;b" -> "c").toString() === "a%3Bb=c"
|
||||
}
|
||||
"encode special separators in query parameter values" in {
|
||||
Query("a" -> "b=c").toString() === "a=b%3Dc"
|
||||
Query("a" -> "b&c").toString() === "a=b%26c"
|
||||
Query("a" -> "b+c").toString() === "a=b%2Bc"
|
||||
Query("a" -> "b;c").toString() === "a=b%3Bc"
|
||||
}
|
||||
}
|
||||
|
||||
"URIs" should {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue