Skip to content

Commit

Permalink
return if hijack failed
Browse files Browse the repository at this point in the history
  • Loading branch information
darren committed Feb 5, 2019
1 parent 2cd8a2a commit 4824637
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ func (s *Server) handleConnect(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Hijacking not supported", http.StatusInternalServerError)
return
}
src, buf, err := hijacker.Hijack()

src, buf, err := hijacker.Hijack()
if err != nil {
http.Error(w, err.Error(), http.StatusServiceUnavailable)
return
}

src = combine(buf, src)
Expand Down

0 comments on commit 4824637

Please sign in to comment.