Broker host: case-insensitive header lookup - #119
Open
andre-merzky wants to merge 1 commit into
Open
Conversation
The gateway path goes through starlette, which lowercases header names; an in-process caller (BrokerCaller) hands its dict to handle_request verbatim. A client sending 'Content-Type: application/msgpack' missed the lowercase lookup, the body fell through to the JSON default, and json.loads died on the first msgpack byte as invalid utf-8 -- the task dispatcher's rhapsody-dialect bulk submit hit exactly this from the DT service's pool-backed engine (first live pool run). Headers are still not passed into the RequestShim: a client-supplied x-orbit-src must not surface as a trusted owner on this path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Npyz3Hbnwos12ESsdJ2YU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First live run of a dispatcher pool behind the DT service hit
submit_rhwith HTTP 500:'utf-8' codec can't decode byte 0x81 in position 0.Root cause:
BrokerPluginHost.handle_requestlooks upcontent-typein the caller's header dict. The gateway path is normalised by starlette, but the in-processBrokerCallerpath passes the dict verbatim —Content-Type: application/msgpackmissed the lookup, the msgpack body fell to the JSON default, andjson.loadsdied on the first msgpack byte. The repeated submit failures then failed the engine, which closed the session and tore down the pool.Fix: lowercase the header keys before the lookup. Headers are still not forwarded into the
RequestShim— a client-suppliedx-orbit-srcmust not surface as a trusted owner on this path (documented in place).Tests: two new (msgpack body with capitalized Content-Type — reproduces the failure against the unfixed code — and the JSON default). Full suite: 1029 passed.
🤖 Generated with Claude Code
https://claude.ai/code/session_016Npyz3Hbnwos12ESsdJ2YU