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 Alex Vulaj
parent 1e975a03ce
commit 0f0acefeac
1 changed files with 1 additions and 4 deletions

View File

@ -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())
}