You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but the gorilla Upgrade func itself already writes HTTP errors if Upgrader.Upgrade() returns an error, quoting the source of v1.5.0:
// If the upgrade fails, then Upgrade replies to the client with an HTTP error// response.func (u*Upgrader) Upgrade(w http.ResponseWriter, r*http.Request, responseHeader http.Header) (*Conn, error)
so we end up attempting to overwrite response headers every time an upgrade fails (e.g. when CheckOrigin returns false, a HTTP 403 Forbidden is written in Upgrader.Upgrade(), but we attempt to overwrite it with 400 Bad Request).
It's nothing dramatic, but my console is full of:
[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 403 with 400
The text was updated successfully, but these errors were encountered:
In transport/websocket.go, when
Upgrader.Upgrade()
returns an error, we try to send ahttp.StatusBadRequest
but the gorilla Upgrade func itself already writes HTTP errors if
Upgrader.Upgrade()
returns an error, quoting the source of v1.5.0:so we end up attempting to overwrite response headers every time an upgrade fails (e.g. when
CheckOrigin
returnsfalse
, a HTTP 403 Forbidden is written in Upgrader.Upgrade(), but we attempt to overwrite it with 400 Bad Request).It's nothing dramatic, but my console is full of:
The text was updated successfully, but these errors were encountered: