Revert "Fix parseUri to sanitize urls containing ASCII newline or tab (#17967)" (#17984)

This reverts commit f4dd95f3be.
This commit is contained in:
Andreas Rumpf 2021-05-09 23:33:31 +02:00 • committed by GitHub
commit 983a2aa11c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 42 deletions

View file

@ -141,18 +141,6 @@ template main() =
doAssert test.port == ""
doAssert test.path == "/foo/bar/baz.txt"
block: # Strict
doAssertRaises(UriParseError):
discard parseUri("https://nim-lang\n.org\t/docs/\nalert('msg\r\n')/?query\n=\tvalue#frag\nment")
# Non-strict would sanitize newline and tab characters from input
let test = parseUri("https://nim-lang\n.org\t/docs/\nalert('msg\r\n')/?query\n=\tvalue#frag\nment", strict=false)
assert test.scheme == "https"
assert test.hostname == "nim-lang.org"
assert test.path == "/docs/alert('msg')/"
assert test.query == "query=value"
assert test.anchor == "fragment"
block: # combine
block:
let concat = combine(parseUri("http://google.com/foo/bar/"), parseUri("baz"))