aboutsummaryrefslogtreecommitdiff
path: root/strings.go
diff options
context:
space:
mode:
authorGravatar Sergey Ponomarev <stokito@gmail.com> 2023-01-02 06:51:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-02 12:51:39 +0800
commit51048b0620ebd25e3bd0c78b53051e02ae33cd3c (patch)
tree62e2ee380cda9a2aa7923dc4b1ab5fee65911a48 /strings.go
parentfix: client may remove hostclient incorrectly (#1461) (diff)
downloadfasthttp-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.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings.go b/strings.go
index 370e307..dd7a827 100644
--- a/strings.go
+++ b/strings.go
@@ -2,7 +2,7 @@ package fasthttp
var (
defaultServerName = []byte("fasthttp")
- defaultUserAgent = []byte("fasthttp")
+ defaultUserAgent = "fasthttp"
defaultContentType = []byte("text/plain; charset=utf-8")
)