fix: don't use errors.ErrUnsupported, it's available only since go1.21

This commit is contained in:
merlin 2023-12-13 22:28:24 +02:00 committed by Canelo Hill
parent 985578c261
commit 22bd06da63
1 changed files with 1 additions and 4 deletions

View File

@ -173,10 +173,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())
}