Repository navigation
Update to refined content-type spec - #464
Merged
Merged
Conversation
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
stefanvanburen
approved these changes
Nov 11, 2026
stefanvanburen
left a comment
Member
There was a problem hiding this comment.
Looks good to me; matches connectrpc/connectrpc.com#447 as far as I can tell. A few small things, none blocking:
validate_responseandvalidate_stream_responseparse the content type and thencodec_name_from_content_typeparses it again; maybe just have one return both?- The
return ""for "JSON with a bad charset" only works becauseself._codecs.get("")misses and we 415; might be worth a comment (orNone) so nobody accidentally registers a codec under""😅. - The new client tests live in
test/test_client_shared.py, which otherwise tests_client_shared— not sure if there's a better home forConnectClientProtocoltests. Andtest_proto_charset_ignoreddoesn't seem to have an async twin like its neighbors.
(FWIW, _parse_content_type splits on ; without respecting quotes, so something like foo="a;charset=latin1" would 415. Pretty contrived, and conformance doesn't cover it, so probably fine to leave.)
Collaborator
Author
Don't think that'll happen so leaving it ;) |
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.
Ignores content-type parameters except for JSON which must be utf-8
connectrpc/connectrpc.com#447
connectrpc/conformance#1191