diff options
author | Mike Faraponov <11322032+moredure@users.noreply.github.com> | 2021-03-20 16:57:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-20 15:57:57 +0100 |
commit | a5830066b63ab5b9664597a7d33ed44bd6264b31 (patch) | |
tree | 35ea2c703b9b6acb1783e4a943cf07e9f749ec78 /uri.go | |
parent | Fix unexpected panic when calling Do of a PipelineClient (#997) (diff) | |
download | fasthttp-a5830066b63ab5b9664597a7d33ed44bd6264b31.tar.gz fasthttp-a5830066b63ab5b9664597a7d33ed44bd6264b31.tar.bz2 fasthttp-a5830066b63ab5b9664597a7d33ed44bd6264b31.zip |
Use bytes.IndexByte instead of bytes.Index for single byte lookup (#999)
* Update uri.go
* Update strings.go
Diffstat (limited to 'uri.go')
-rw-r--r-- | uri.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -285,11 +285,11 @@ func (u *URI) parse(host, uri []byte, isTLS bool) error { u.scheme = append(u.scheme[:0], strHTTPS...) } - if n := bytes.Index(host, strAt); n >= 0 { + if n := bytes.IndexByte(host, '@'); n >= 0 { auth := host[:n] host = host[n+1:] - if n := bytes.Index(auth, strColon); n >= 0 { + if n := bytes.IndexByte(auth, ':'); n >= 0 { u.username = append(u.username[:0], auth[:n]...) u.password = append(u.password[:0], auth[n+1:]...) } else { |