diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2020-05-25 20:26:56 +0200 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2020-05-25 20:27:15 +0200 |
commit | 123f6a8cee92a692af12c77d82cd15cf3515e39b (patch) | |
tree | ae970de43e53517075eb0e23fcf02f23a6a249de /uri.go | |
parent | Merge pull request #810 from valyala/brotli (diff) | |
download | fasthttp-123f6a8cee92a692af12c77d82cd15cf3515e39b.tar.gz fasthttp-123f6a8cee92a692af12c77d82cd15cf3515e39b.tar.bz2 fasthttp-123f6a8cee92a692af12c77d82cd15cf3515e39b.zip |
Fix memory reusage bug with auth
Fixes #814
Diffstat (limited to 'uri.go')
-rw-r--r-- | uri.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -284,11 +284,11 @@ func (u *URI) parse(host, uri []byte, isTLS bool) { host = host[n+1:] if n := bytes.Index(auth, strColon); n >= 0 { - u.username = auth[:n] - u.password = auth[n+1:] + u.username = append(u.username[:0], auth[:n]...) + u.password = append(u.password[:0], auth[n+1:]...) } else { - u.username = auth - u.password = auth[:0] // Make sure it's not nil + u.username = append(u.username[:0], auth...) + u.password = u.password[:0] } } |