summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/gorilla/websocket/server.go
diff options
context:
space:
mode:
authorYuri Tkachenko <yuri.tam.tkachenko@gmail.com>2015-11-30 12:15:28 +0300
committerYuri Tkachenko <yuri.tam.tkachenko@gmail.com>2015-11-30 12:15:28 +0300
commit8b982f7effa336a503ab61c676ee0f2473de6e3b (patch)
treeecd49a12e3cb9e4bff398057df01d44eade70da4 /Godeps/_workspace/src/github.com/gorilla/websocket/server.go
parent71b548ef052d4e84ea0d067df51e4850ffdba572 (diff)
parentd4eb8743e3bd36b6cd2e7939c9a698d893b215d7 (diff)
downloadchat-8b982f7effa336a503ab61c676ee0f2473de6e3b.tar.gz
chat-8b982f7effa336a503ab61c676ee0f2473de6e3b.tar.bz2
chat-8b982f7effa336a503ab61c676ee0f2473de6e3b.zip
Merge remote-tracking branch 'mattermost/master' into patch-1
Diffstat (limited to 'Godeps/_workspace/src/github.com/gorilla/websocket/server.go')
-rw-r--r--Godeps/_workspace/src/github.com/gorilla/websocket/server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/server.go b/Godeps/_workspace/src/github.com/gorilla/websocket/server.go
index e56a00493..3a9805f02 100644
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/server.go
+++ b/Godeps/_workspace/src/github.com/gorilla/websocket/server.go
@@ -93,6 +93,9 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
// request. Use the responseHeader to specify cookies (Set-Cookie) and the
// application negotiated subprotocol (Sec-Websocket-Protocol).
func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) {
+ if r.Method != "GET" {
+ return u.returnError(w, r, http.StatusMethodNotAllowed, "websocket: method not GET")
+ }
if values := r.Header["Sec-Websocket-Version"]; len(values) == 0 || values[0] != "13" {
return u.returnError(w, r, http.StatusBadRequest, "websocket: version != 13")
}