=htc add test to verify URI against a very long path

Was reported in Spray gitter channel, spray's URI throws an StackOverflowException for such URI.
Adding the test to make our URI survives it (it does), and that it stays this way.
This commit is contained in:
Konrad Malawski 2015-11-21 20:43:44 +01:00
parent ce2d666c06
commit ee9a95e33b

View file

@ -609,5 +609,11 @@ class UriSpec extends WordSpec with Matchers {
Uri("http://example.com/foo/bar?query=1#frag").toHttpRequestTargetOriginForm.toString === "/foo/bar?query=1"
Uri("http://example.com//foo/bar?query=1#frag").toHttpRequestTargetOriginForm.toString === "//foo/bar?query=1"
}
"survive parsing a URI with thousands of path segments" in {
val slashes = "/a/" * 2000
val uri = Uri(s"http://foo.bar/$slashes")
uri.toString // was reported to throw StackOverflowException in Spray's URI
}
}
}