little documentation fix on conbine and /
This commit is contained in:
parent
ef44fd344b
commit
aa62dcc2af
1 changed files with 4 additions and 4 deletions
|
|
@ -184,10 +184,10 @@ proc combine*(base: Uri, reference: Uri): Uri =
|
||||||
## assert foo.path == "/baz"
|
## assert foo.path == "/baz"
|
||||||
##
|
##
|
||||||
## let bar = combine(parseUri("http://example.com/foo/bar"), parseUri("baz"))
|
## let bar = combine(parseUri("http://example.com/foo/bar"), parseUri("baz"))
|
||||||
## assert foo.path == "/foo/baz"
|
## assert bar.path == "/foo/baz"
|
||||||
##
|
##
|
||||||
## let bar = combine(parseUri("http://example.com/foo/bar/"), parseUri("baz"))
|
## let bar = combine(parseUri("http://example.com/foo/bar/"), parseUri("baz"))
|
||||||
## assert foo.path == "/foo/bar/baz"
|
## assert bar.path == "/foo/bar/baz"
|
||||||
|
|
||||||
template setAuthority(dest, src: expr): stmt =
|
template setAuthority(dest, src: expr): stmt =
|
||||||
dest.hostname = src.hostname
|
dest.hostname = src.hostname
|
||||||
|
|
@ -241,10 +241,10 @@ proc `/`*(x: Uri, path: string): Uri =
|
||||||
## assert foo.path == "/foo/bar/baz"
|
## assert foo.path == "/foo/bar/baz"
|
||||||
##
|
##
|
||||||
## let bar = parseUri("http://example.com/foo/bar") / parseUri("baz")
|
## let bar = parseUri("http://example.com/foo/bar") / parseUri("baz")
|
||||||
## assert foo.path == "/foo/bar/baz"
|
## assert bar.path == "/foo/bar/baz"
|
||||||
##
|
##
|
||||||
## let bar = parseUri("http://example.com/foo/bar/") / parseUri("baz")
|
## let bar = parseUri("http://example.com/foo/bar/") / parseUri("baz")
|
||||||
## assert foo.path == "/foo/bar/baz"
|
## assert bar.path == "/foo/bar/baz"
|
||||||
result = x
|
result = x
|
||||||
if result.path[result.path.len-1] == '/':
|
if result.path[result.path.len-1] == '/':
|
||||||
if path[0] == '/':
|
if path[0] == '/':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue