(t *testing.T)
| 483 | } |
| 484 | |
| 485 | func TestDialExtraTokensInRespHeaders(t *testing.T) { |
| 486 | s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 487 | challengeKey := r.Header.Get("Sec-Websocket-Key") |
| 488 | w.Header().Set("Upgrade", "foo, websocket") |
| 489 | w.Header().Set("Connection", "upgrade, keep-alive") |
| 490 | w.Header().Set("Sec-Websocket-Accept", computeAcceptKey(challengeKey)) |
| 491 | w.WriteHeader(101) |
| 492 | })) |
| 493 | defer s.Close() |
| 494 | |
| 495 | ws, _, err := cstDialer.Dial(makeWsProto(s.URL), nil) |
| 496 | if err != nil { |
| 497 | t.Fatalf("Dial: %v", err) |
| 498 | } |
| 499 | defer ws.Close() |
| 500 | } |
| 501 | |
| 502 | func TestHandshake(t *testing.T) { |
| 503 | s := newServer(t) |
nothing calls this directly
no test coverage detected