mirror of https://github.com/gorilla/websocket.git
Check and handle error return from hijack.
This commit is contained in:
parent
365b7a442d
commit
4292df70df
|
@ -137,6 +137,9 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
||||||
}
|
}
|
||||||
var rw *bufio.ReadWriter
|
var rw *bufio.ReadWriter
|
||||||
netConn, rw, err = h.Hijack()
|
netConn, rw, err = h.Hijack()
|
||||||
|
if err != nil {
|
||||||
|
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
br = rw.Reader
|
br = rw.Reader
|
||||||
|
|
||||||
if br.Buffered() > 0 {
|
if br.Buffered() > 0 {
|
||||||
|
|
Loading…
Reference in New Issue