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
1e975a03ce
commit
0f0acefeac
|
@ -175,10 +175,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
|
|||
}
|
||||
|
||||
netConn, brw, err := http.NewResponseController(w).Hijack()
|
||||
switch {
|
||||
case errors.Is(err, errors.ErrUnsupported):
|
||||
return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker")
|
||||
case err != nil:
|
||||
if err != nil {
|
||||
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue