diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-16 15:49:04 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-16 15:49:04 -0500 |
commit | f54936467101bb08bbdf7f3d9c341134c06b83c3 (patch) | |
tree | 5976a456548fce8beb79014c7c2780afeea89a8a /Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go | |
parent | f08deca79f24ff1efe086483a091cf807a5a2e14 (diff) | |
download | chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.tar.gz chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.tar.bz2 chat-f54936467101bb08bbdf7f3d9c341134c06b83c3.zip |
Updating go dependancies
Diffstat (limited to 'Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go b/Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go index 05a7888fe..c67550e92 100644 --- a/Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go +++ b/Godeps/_workspace/src/github.com/gorilla/websocket/client_server_test.go @@ -41,9 +41,16 @@ type cstServer struct { URL string } +const ( + cstPath = "/a/b" + cstRawQuery = "x=y" + cstRequestURI = cstPath + "?" + cstRawQuery +) + func newServer(t *testing.T) *cstServer { var s cstServer s.Server = httptest.NewServer(cstHandler{t}) + s.Server.URL += cstRequestURI s.URL = makeWsProto(s.Server.URL) return &s } @@ -51,11 +58,22 @@ func newServer(t *testing.T) *cstServer { func newTLSServer(t *testing.T) *cstServer { var s cstServer s.Server = httptest.NewTLSServer(cstHandler{t}) + s.Server.URL += cstRequestURI s.URL = makeWsProto(s.Server.URL) return &s } func (t cstHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != cstPath { + t.Logf("path=%v, want %v", r.URL.Path, cstPath) + http.Error(w, "bad path", 400) + return + } + if r.URL.RawQuery != cstRawQuery { + t.Logf("query=%v, want %v", r.URL.RawQuery, cstRawQuery) + http.Error(w, "bad path", 400) + return + } subprotos := Subprotocols(r) if !reflect.DeepEqual(subprotos, cstDialer.Subprotocols) { t.Logf("subprotols=%v, want %v", subprotos, cstDialer.Subprotocols) @@ -188,7 +206,7 @@ func TestDialTLS(t *testing.T) { d := cstDialer d.NetDial = func(network, addr string) (net.Conn, error) { return net.Dial(network, u.Host) } d.TLSClientConfig = &tls.Config{RootCAs: certs} - ws, _, err := d.Dial("wss://example.com/", nil) + ws, _, err := d.Dial("wss://example.com"+cstRequestURI, nil) if err != nil { t.Fatalf("Dial: %v", err) } |