good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 305eab9a authored by Anmol Sethi's avatar Anmol Sethi
Browse files

misc: Format and compile #360

parent 309e088c
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,11 @@ import (
"net"
"net/http"
"net/http/httptest"
"nhooyr.io/websocket/internal/test/xrand"
"strings"
"testing"
"nhooyr.io/websocket/internal/test/assert"
"nhooyr.io/websocket/internal/test/xrand"
)
func TestAccept(t *testing.T) {
......@@ -68,7 +68,7 @@ func TestAccept(t *testing.T) {
r.Header.Set("Connection", "Upgrade")
r.Header.Set("Upgrade", "websocket")
r.Header.Set("Sec-WebSocket-Version", "13")
r.Header.Set("Sec-WebSocket-Key", "meow123")
r.Header.Set("Sec-WebSocket-Key", xrand.Base64(16))
r.Header.Set("Sec-WebSocket-Extensions", extensions)
return r
}
......
......@@ -47,6 +47,7 @@ func Int(max int) int {
return int(x.Int64())
}
// Base64 returns a randomly generated base64 string of length n.
func Base64(n int) string {
return base64.StdEncoding.EncodeToString(Bytes(n))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment