Repository navigation
Reject a publish request with no stream key as a client error - #551
Merged
Merged
Conversation
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>
biglittlebigben
approved these changes
Nov 4, 2026
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.
A WHIP publish with no
Authorizationheader, or an RTMP publish whose name ends in/, reacheshandleRequestwith 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 asinternalinpublish_status. A request with no key can never succeed, so this is a client error.handleRequestnow rejects a request that has neither a stream key nor ingress info with the existingErrMissingStreamKey(InvalidArgument, HTTP 400), before the lookup. The request is then counted as4xx. URL pull requests always carry ingress info and are unaffected.TestPublishRequestWithEmptyStreamKeyIsClientErrorpublishes 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 withexpected: 400, actual: 500.Not covered here: an IOInfo server that receives a
GetIngressInforequest with neither a key nor an ingress ID returns an error without a code, which callers see as a 500. Giving that error anInvalidArgumentcode is a separate server-side change.🤖 Generated with Claude Code