diff options
author | Sergey Ponomarev <stokito@gmail.com> | 2023-01-02 06:51:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 12:51:39 +0800 |
commit | 51048b0620ebd25e3bd0c78b53051e02ae33cd3c (patch) | |
tree | 62e2ee380cda9a2aa7923dc4b1ab5fee65911a48 /strings.go | |
parent | fix: client may remove hostclient incorrectly (#1461) (diff) | |
download | fasthttp-51048b0620ebd25e3bd0c78b53051e02ae33cd3c.tar.gz fasthttp-51048b0620ebd25e3bd0c78b53051e02ae33cd3c.tar.bz2 fasthttp-51048b0620ebd25e3bd0c78b53051e02ae33cd3c.zip |
client.go Simplify default UA logic (#1466)
The getClientName() checks if !NoDefaultUserAgentHeader then returns the Client.Name field.
But it also saves it to atomic field clientName. This is not needed and logic can be simplified.
Previously the clientName vas a byte slice that was copied from c.Name and cached. See 02e0722fb73c6237818b8e5af55957eb919a7334
Fix #1458
Diffstat (limited to 'strings.go')
-rw-r--r-- | strings.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2,7 +2,7 @@ package fasthttp var ( defaultServerName = []byte("fasthttp") - defaultUserAgent = []byte("fasthttp") + defaultUserAgent = "fasthttp" defaultContentType = []byte("text/plain; charset=utf-8") ) |