Repository navigation
Conversation
… present Signed-off-by: Kong Liangyu <201232322+yumingjs@users.noreply.github.com>
EmiRZx
approved these changes
Dec 3, 2026
EmiRZx
left a comment
There was a problem hiding this comment.
this covers the Kafka case I noted on #316. tested from_kafka with structured messages that also carry ce_ headers. a lone ce_subject no longer fails validation. with all required headers the envelope is read instead of becoming the data. mixed case, a charset parameter, a space before ; and a capitalized Content-Type name all stay structured. application/json and text/plain with headers still go binary. the new tests fail on main. it merges cleanly with #336. that one touches the same file.
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 #338
Type of change: Bug fix
Description
A structured Kafka event can also carry
ce_headers. Check the media type against the supplied event format before using those headers to infer binary mode. This keeps the envelope authoritative and preserves the existing fallback for other content types.The regression cases cover a single metadata header, which caused a validation error, and all required headers, which caused the entire envelope to become the payload. They also cover mixed casing and a charset parameter. A binary message with
application/jsonstill uses its headers.Verification
Both regression cases failed before the change. Afterward, all 356 core tests passed on Python 3.11.9. Ruff lint and formatting checks passed for both changed files.
Pre-submission checklist