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 jaitaiwan committed Jun 19, 2024
1 parent c750209 commit 8890e3e
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 @@ -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())
}

Expand Down

0 comments on commit 8890e3e

Please # to comment.