We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3757487 commit e582c1fCopy full SHA for e582c1f
internal/websocket/util.go
@@ -10,7 +10,6 @@ import (
10
"encoding/base64"
11
"io"
12
"net/http"
13
- "slices"
14
"strings"
15
"sync"
16
"unicode/utf8"
@@ -44,11 +43,7 @@ func encodeAcceptKey(challengeKey string, p []byte) []byte {
44
43
*bufPtr = (*bufPtr)[:0]
45
sum := h.Sum(*bufPtr)
46
47
- // replace with base64.AppendEncode when we can depend on Go 1.22.
48
- n := base64.StdEncoding.EncodedLen(len(sum))
49
- p = slices.Grow(p, n)
50
- base64.StdEncoding.Encode(p[len(p):][:n], sum)
51
- return p[:len(p)+n]
+ return base64.StdEncoding.AppendEncode(p, sum)
52
}
53
54
func generateChallengeKey() (string, error) {
0 commit comments