mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
@@ -294,7 +294,7 @@ func parseUri*(uri: string, result: var Uri) =
|
||||
var i = 0
|
||||
|
||||
# Check if this is a reference URI (relative URI)
|
||||
let doubleSlash = uri.len > 1 and uri[1] == '/'
|
||||
let doubleSlash = uri.len > 1 and uri[0] == '/' and uri[1] == '/'
|
||||
if i < uri.len and uri[i] == '/':
|
||||
# Make sure `uri` doesn't begin with '//'.
|
||||
if not doubleSlash:
|
||||
|
||||
@@ -283,5 +283,16 @@ template main() =
|
||||
doAssert toSeq(decodeQuery("a=1&b=0")) == @[("a", "1"), ("b", "0")]
|
||||
doAssert toSeq(decodeQuery("a=1&b=2c=6")) == @[("a", "1"), ("b", "2c=6")]
|
||||
|
||||
block: # bug #17481
|
||||
let u1 = parseUri("./")
|
||||
let u2 = parseUri("./path")
|
||||
let u3 = parseUri("a/path")
|
||||
doAssert u1.scheme.len == 0
|
||||
doAssert u1.path == "./"
|
||||
doAssert u2.scheme.len == 0
|
||||
doAssert u2.path == "./path"
|
||||
doAssert u3.scheme.len == 0
|
||||
doAssert u3.path == "a/path"
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user