Skip to content

Commit

Permalink
fix: don't use errors.ErrUnsupported, it's available only since go1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
ninedraft authored and AlexVulaj committed Jan 22, 2024
1 parent 1e975a0 commit 0f0acef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 0f0acef

Please sign in to comment.