diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2017-01-09 10:50:56 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2017-01-09 10:50:56 +0200 |
commit | 0a7f0a797cd66b89588d0a7fdd670b706579a621 (patch) | |
tree | 13dbd645a0d77cdf3681b61d0de5a379be8d0a62 /uri.go | |
parent | Added RequestCtx.LocalIP() (diff) | |
download | fasthttp-0a7f0a797cd66b89588d0a7fdd670b706579a621.tar.gz fasthttp-0a7f0a797cd66b89588d0a7fdd670b706579a621.tar.bz2 fasthttp-0a7f0a797cd66b89588d0a7fdd670b706579a621.zip |
Updated tests and documentation for URI.Parse and URI.Update* regarding uris without scheme
Diffstat (limited to 'uri.go')
-rw-r--r-- | uri.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -213,6 +213,11 @@ func (u *URI) SetHostBytes(host []byte) { } // Parse initializes URI from the given host and uri. +// +// host may be nil. In this case uri must contain fully qualified uri, +// i.e. with scheme and host. http is assumed if scheme is omitted. +// +// uri may contain e.g. RequestURI without scheme and host if host is non-empty. func (u *URI) Parse(host, uri []byte) { u.parse(host, uri, nil) } @@ -369,6 +374,8 @@ func (u *URI) LastPathSegment() []byte { // // * Absolute, i.e. http://foobar.com/aaa/bb?cc . In this case the original // uri is replaced by newURI. +// * Absolute without scheme, i.e. //foobar.com/aaa/bb?cc. In this case +// the original scheme is preserved. // * Missing host, i.e. /aaa/bb?cc . In this case only RequestURI part // of the original uri is replaced. // * Relative path, i.e. xx?yy=abc . In this case the original RequestURI @@ -383,6 +390,8 @@ func (u *URI) Update(newURI string) { // // * Absolute, i.e. http://foobar.com/aaa/bb?cc . In this case the original // uri is replaced by newURI. +// * Absolute without scheme, i.e. //foobar.com/aaa/bb?cc. In this case +// the original scheme is preserved. // * Missing host, i.e. /aaa/bb?cc . In this case only RequestURI part // of the original uri is replaced. // * Relative path, i.e. xx?yy=abc . In this case the original RequestURI |