internal/proxy/request.go, modifyResponse and answer. modifyResponse notes status 101 in rq.out.status as soon as the app answers 101. httputil.ReverseProxy then refuses the switch when the app's Upgrade differs from the client's, and calls answerError, whose answer(502) returns at once because rq.out.status is no longer 0, although nothing was sent. The handler returns having written nothing, and Go's server sends 200 OK with an empty body.
Repro, at the defaults: a client sends GET /ws HTTP/1.1 with Connection: Upgrade and Upgrade: websocket, foo, and the app answers 101 Switching Protocols with Upgrade: websocket, as an app that accepts any Upgrade list holding websocket would. The client gets 200; the log line has status 101 and action upstream_error.
README, request log: "status is what the client was sent". The client is told the exchange succeeded when it failed; answerError meant to send 502.
From reading the code, not tested: nothing closes the app's switched connection on this path.
Severity: minor.
Model: opus-5-5
`internal/proxy/request.go`, `modifyResponse` and `answer`. `modifyResponse` notes status 101 in `rq.out.status` as soon as the app answers 101. `httputil.ReverseProxy` then refuses the switch when the app's `Upgrade` differs from the client's, and calls `answerError`, whose `answer(502)` returns at once because `rq.out.status` is no longer 0, although nothing was sent. The handler returns having written nothing, and Go's server sends `200 OK` with an empty body.
Repro, at the defaults: a client sends `GET /ws HTTP/1.1` with `Connection: Upgrade` and `Upgrade: websocket, foo`, and the app answers `101 Switching Protocols` with `Upgrade: websocket`, as an app that accepts any `Upgrade` list holding `websocket` would. The client gets `200`; the log line has status 101 and action `upstream_error`.
README, request log: "`status` is what the client was sent". The client is told the exchange succeeded when it failed; `answerError` meant to send 502.
From reading the code, not tested: nothing closes the app's switched connection on this path.
Severity: minor.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
internal/proxy/request.go,modifyResponseandanswer.modifyResponsenotes status 101 inrq.out.statusas soon as the app answers 101.httputil.ReverseProxythen refuses the switch when the app'sUpgradediffers from the client's, and callsanswerError, whoseanswer(502)returns at once becauserq.out.statusis no longer 0, although nothing was sent. The handler returns having written nothing, and Go's server sends200 OKwith an empty body.Repro, at the defaults: a client sends
GET /ws HTTP/1.1withConnection: UpgradeandUpgrade: websocket, foo, and the app answers101 Switching ProtocolswithUpgrade: websocket, as an app that accepts anyUpgradelist holdingwebsocketwould. The client gets200; the log line has status 101 and actionupstream_error.README, request log: "
statusis what the client was sent". The client is told the exchange succeeded when it failed;answerErrormeant to send 502.From reading the code, not tested: nothing closes the app's switched connection on this path.
Severity: minor.
Model: opus-5-5