parent
861c42c258
commit
1f1ef85eb0
2 changed files with 12 additions and 1 deletions
|
|
@ -294,7 +294,7 @@ func parseUri*(uri: string, result: var Uri) =
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
||||||
# Check if this is a reference URI (relative URI)
|
# 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] == '/':
|
if i < uri.len and uri[i] == '/':
|
||||||
# Make sure `uri` doesn't begin with '//'.
|
# Make sure `uri` doesn't begin with '//'.
|
||||||
if not doubleSlash:
|
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=0")) == @[("a", "1"), ("b", "0")]
|
||||||
doAssert toSeq(decodeQuery("a=1&b=2c=6")) == @[("a", "1"), ("b", "2c=6")]
|
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()
|
static: main()
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue