Commit Graph
2 Commits
Author SHA1 Message Date
Hasan BasbunarandClaude Opus 5.5 0b27e26d99 proxy: the serving key is checked before a body is read
Without the identity wall, the engine's key is the port's one gate (README), and a
request without it still had its body read whole and, when large, counted by the
engine on the proxy's own key before the engine's 401. The proxy now applies the
engine's own rule first (measured on the live engine: bearer in any case, one space,
the key exactly) and answers the engine's own 401, before the body and before an
Expect: 100-continue invitation; /health and /metrics stay open. The test harnesses
decide which key their proxy holds, whatever HOME holds: those that give it one
present it, as every real client does, and those whose clients send none give it
none (the CI's offline step gives HOME a key). The cockpit knows the new outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 15:01:56 +02:00
Hasan BasbunarandClaude Opus 5.5 7191bd8368 proxy v6.33: one Server header and one Date on every relayed answer
The proxy writes its own Server and Date (send_response) and relayed
the engine's beside them: uvicorn's `server: uvicorn` and `date` came
next to the proxy's, two of each on every relayed answer, which RFC 9110
(5.3) does not allow. aiohttp refuses such an answer by default in
3.13.4 and in its strict mode since then, and a LiteLLM gateway in front
of the proxy failed with "Duplicate 'Server' header found." (issue #39).

The engine's two are no longer relayed (RESPONSE_DROP, as the cockpit's
agent relay already has). The headers of the requests sent to the engine
are unchanged, which adding the two to HOP, as the issue proposed, would
not have kept. tests/test_proxy_answer_headers.py reads the header block
of a relayed GET, a generation whole and streamed, and an error of the
engine: its four tests fail on v6.32, and four hand-made mutants (either
relay path, Date alone, every engine header dropped) are caught.

Checked on the reference box's flash lane: through v6.32 every relayed
answer had two of each (ten routes, /v1/responses included) and LiteLLM
1.104.0 under strict aiohttp gave the issue's error; through v6.33 none
had, and LiteLLM answered, streamed or not. Claude Code, opencode,
Hermes Agent and pi each read a file with a tool and answered from it
through both. The 29 test files that read keepalive-proxy.py pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 11:39:30 +02:00