fix case sensitive header check

This commit is contained in:
Pieter Joost van de Sande 2015-12-17 15:03:14 +01:00
parent 3986be78bf
commit 8600ce78d1
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
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" {
if values := r.Header.Get("Sec-Websocket-Version"); len(values) == 0 || values != "13" {
return u.returnError(w, r, http.StatusBadRequest, "websocket: version != 13")
}