Prevent processing of zero-byte config payloads#12
Merged
Conversation
Added validation to reject zero-byte config payloads from both HTTP and SSE endpoints, treating them as connection errors that trigger retries. Changes: - Added zero-byte validation in config_sdk.py for HTTP responses - Added zero-byte validation in _sse_connection_manager.py for SSE events - Return False/early when zero-byte payloads detected to trigger retry logic - Added comprehensive tests for both HTTP and SSE scenarios This prevents the SDK from attempting to process empty config data which would likely cause parsing errors or unexpected behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Add validation to reject zero-byte config payloads from both HTTP and SSE endpoints, treating them as connection errors that trigger retry logic.
Problem
The SDK could potentially attempt to process empty config data, which would likely cause parsing errors or unexpected behavior.
Solution
config_sdk.pyfor HTTP responses_sse_connection_manager.pyfor SSE eventsFalseto trigger fallback/retry logicTesting
🤖 Generated with Claude Code