mirror of https://github.com/gorilla/websocket.git
fix: don't use errors.ErrUnsupported, it's available only since go1.21
This commit is contained in:
parent
985578c261
commit
22bd06da63
|
@ -173,10 +173,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
||||||
}
|
}
|
||||||
|
|
||||||
netConn, brw, err := http.NewResponseController(w).Hijack()
|
netConn, brw, err := http.NewResponseController(w).Hijack()
|
||||||
switch {
|
if err != nil {
|
||||||
case errors.Is(err, errors.ErrUnsupported):
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker")
|
|
||||||
case err != nil:
|
|
||||||
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue