Skip to content

Reject a publish request with no stream key as a client error - #551

Merged
pksgit merged 1 commit into
mainfrom
pradeepsharma/cs-2229-reject-empty-stream-key
Nov 4, 2026
Merged

pksgit merged 1 commit into
mainfrom
pradeepsharma/cs-2229-reject-empty-stream-key

Conversation

@pksgit

@pksgit pksgit commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

A WHIP publish with no Authorization header, or an RTMP publish whose name ends in /, reaches handleRequest with an empty stream key. The key was looked up anyway, the lookup failed, and the failure came back to the client as a 500 and was counted as internal in publish_status. A request with no key can never succeed, so this is a client error.

handleRequest now rejects a request that has neither a stream key nor ingress info with the existing ErrMissingStreamKey (InvalidArgument, HTTP 400), before the lookup. The request is then counted as 4xx. URL pull requests always carry ingress info and are unaffected.

TestPublishRequestWithEmptyStreamKeyIsClientError publishes over WHIP and RTMP with an empty key against a fake IOInfo client. It checks for a 400 and that the client is never called. Without the fix, both cases fail with expected: 400, actual: 500.

Not covered here: an IOInfo server that receives a GetIngressInfo request with neither a key nor an ingress ID returns an error without a code, which callers see as a 500. Giving that error an InvalidArgument code is a separate server-side change.

🤖 Generated with Claude Code

A WHIP or RTMP publish with an empty stream key was looked up anyway, and
the lookup failure came back as an internal error: a 500 to the client and
an "internal" publish status. Reject it up front with ErrMissingStreamKey
(400) instead.

CS-2229

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@pksgit
pksgit merged commit dfa5c9b into main Nov 4, 2026
13 checks passed
@pksgit
pksgit deleted the pradeepsharma/cs-2229-reject-empty-stream-key branch November 4, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants