Repository navigation
Conversation
Honor the supplied event format before checking ce- headers, as required by the HTTP binding sections 3 and 3.2.3. Regression tests and changelog follow on this branch before submitting a PR. Assisted-by: ChatGPT (Codex) Signed-off-by: Sonam Sherpa <120879799+BiNKss7@users.noreply.github.com>
Cover redundant metadata headers, Content-Type casing and parameters, explicit and inferred factories, partial metadata, and custom formats. All eight regression cases fail without the source fix. Assisted-by: ChatGPT (Codex) Signed-off-by: Sonam Sherpa <120879799+BiNKss7@users.noreply.github.com>
Document the corrected precedence of structured Content-Type over redundant metadata headers. Assisted-by: ChatGPT (Codex) Signed-off-by: Sonam Sherpa <120879799+BiNKss7@users.noreply.github.com>
5 tasks done
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.
Related Issue: Fixes #314
Type of change: Bug fix
Description:
The core HTTP decoder currently selects binary mode whenever it sees any
ce-*header. A structured request with redundant metadata headers therefore uses the header attributes and treats its entire envelope as data; a lonece-subjectheader can instead make a valid structured event fail validation.Check the request Content-Type against the supplied format media type before inspecting metadata headers. Matching ignores media type casing and parameters, and works with custom formats. Existing fallback handling is preserved. This follows HTTP binding section 3 and section 3.2.3, which permits metadata headers on structured messages.
Correct the existing mixed-headers test that asserted binary precedence, and cover explicit/auto-detected factories, casing, parameters, partial metadata and a custom format. Include a changelog entry. No dependency or public API changes.
Validation (Linux, CPython 3.12.14):
socksioand localhost proxy exclusions for existing Sanic integration tests; project dependencies were not changed.Checklist: