=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:
Mathias 2014-10-02 10:46:06 +02:00
parent 2f6499bcdf
commit 882f47ada8

View file

@ -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 {