Pass only Bad Request reasons

This commit is contained in:
kulti 2017-02-27 16:47:07 +03:00 committed by GitHub
parent 0174e94f99
commit 117e71a447
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,11 @@ func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status in
u.Error(w, r, status, err) u.Error(w, r, status, err)
} else { } else {
w.Header().Set("Sec-Websocket-Version", "13") w.Header().Set("Sec-Websocket-Version", "13")
http.Error(w, reason, status) if status == http.StatusBadRequest {
http.Error(w, reason, status)
} else {
http.Error(w, http.StatusText(status), status)
}
} }
return nil, err return nil, err
} }