aboutsummaryrefslogtreecommitdiff
path: root/server_test.go
diff options
context:
space:
mode:
authorGravatar Sergey Ponomarev <stokito@gmail.com> 2023-01-06 05:55:09 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-06 04:55:09 +0100
commit434022b4611dbac1c294c26feac02abe9fb31e3b (patch)
tree94267c88ec3b7f1679929fcac8b1b6e4e0c0ecf7 /server_test.go
parentclient.go Simplify default UA logic (#1466) (diff)
downloadfasthttp-434022b4611dbac1c294c26feac02abe9fb31e3b.tar.gz
fasthttp-434022b4611dbac1c294c26feac02abe9fb31e3b.tar.bz2
fasthttp-434022b4611dbac1c294c26feac02abe9fb31e3b.zip
server.go Simplify default Server name logic (#1467)
The serverName atomic.Value field is used as a cache. This is not needed and logic can be simplified. See related #1458
Diffstat (limited to 'server_test.go')
-rw-r--r--server_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server_test.go b/server_test.go
index 7d96e93..4599208 100644
--- a/server_test.go
+++ b/server_test.go
@@ -401,8 +401,8 @@ func TestServerName(t *testing.T) {
}
resp := getReponse()
- if !bytes.Contains(resp, []byte("\r\nServer: "+string(defaultServerName)+"\r\n")) {
- t.Fatalf("Unexpected response %q expected Server: "+string(defaultServerName), resp)
+ if !bytes.Contains(resp, []byte("\r\nServer: "+defaultServerName+"\r\n")) {
+ t.Fatalf("Unexpected response %q expected Server: "+defaultServerName, resp)
}
// We can't just overwrite s.Name as fasthttp caches the name in an atomic.Value