Fix panic in hijack
@@ -177,6 +177,7 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (net.Conn, e
// Server hijacks the connection, error 'connection closed' expected
resp, err := clientconn.Do(req)
+ if err != httputil.ErrPersistEOF {
if err != nil {
return nil, err
}
@@ -184,6 +185,7 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (net.Conn, e
resp.Body.Close()
return nil, fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode)
}
+ }
c, br := clientconn.Hijack()
if br.Buffered() > 0 {
