Skip to content

Commit

Permalink
Check and handle error return from hijack.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyburd committed Aug 16, 2014
1 parent 365b7a4 commit 4292df7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
}
var rw *bufio.ReadWriter
netConn, rw, err = h.Hijack()
if err != nil {
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
}
br = rw.Reader

if br.Buffered() > 0 {
Expand Down

0 comments on commit 4292df7

Please sign in to comment.