Skip multipart parts with empty Content-Type instead of raising#598
Open
magicmark wants to merge 1 commit into
Open
Skip multipart parts with empty Content-Type instead of raising#598magicmark wants to merge 1 commit into
magicmark wants to merge 1 commit into
Conversation
b6f13dc to
1ff86bc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 38 40 +2
Lines 2908 3325 +417
==========================================
+ Hits 2908 3325 +417 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Some GraphQL servers send multipart parts without a Content-Type header as heartbeats or keep-alive padding. Previously this raised a TransportProtocolError, crashing the subscription stream. Co-Authored-By: Claude <noreply@anthropic.com>
1ff86bc to
d0d2600
Compare
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.
Multipart HTTP streams may contain empty parts (no headers, no body):
(In our case, we see this (I think) due to being passed through multiple proxies which unpack and pack parts back together)
Anyway our current handling is too strict — it required every part to have
Content-Type: application/jsoninstead of just skipping empty ones.Before
When this happens, applications see traceback like this:
After
✨ empty parts are ignored; no errors