mirror of https://github.com/gorilla/websocket.git
Pass only Bad Request reasons
This commit is contained in:
parent
0174e94f99
commit
117e71a447
|
@ -60,7 +60,11 @@ func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status in
|
|||
u.Error(w, r, status, err)
|
||||
} else {
|
||||
w.Header().Set("Sec-Websocket-Version", "13")
|
||||
if status == http.StatusBadRequest {
|
||||
http.Error(w, reason, status)
|
||||
} else {
|
||||
http.Error(w, http.StatusText(status), status)
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue