Skip to content

Reject malformed Connect END_STREAM JSON#198

Open
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix-invalid-connect-end-stream
Open

Reject malformed Connect END_STREAM JSON#198
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix-invalid-connect-end-stream

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • reject malformed Connect END_STREAM JSON instead of defaulting to a clean success
  • use one strict END_STREAM parser for both server-streaming and client-streaming responses
  • add regression coverage for malformed END_STREAM frames after a valid message

Why

Malformed END_STREAM payloads were being parsed with unwrap_or_default(), which turned invalid JSON into an empty terminal response and let corrupted or truncated stream terminators look successful.

Impact

  • malformed Connect END_STREAM frames now surface as terminal internal errors
  • client-streaming keeps response headers attached on the new error path

Validation

  • cargo test -p connectrpc malformed_end_stream
  • cargo test -p connectrpc end_stream

@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant