fix(http-proxy): rewrite rtsp:// redirect Location onto /rtsp/ - #739
Merged
Conversation
Keep root-relative Location headers such as /rtsp/... unchanged and stop treating them as invalid HTTP URLs. Convert absolute rtsp:// redirects to /rtsp/... so catchup auth helpers can 302 to a real RTSP playback URL and HTTP clients stay on this instance. Closes #707 Co-authored-by: Stackie Jia <jsq2627@gmail.com>
Contributor
Documentation previewThe documentation preview has been deployed for this pull request. |
Align HTTP 30x Location rewriting with the URL schemes M3U transform already recognizes: http://, rtsp://, rtp://, and udp://. Co-authored-by: Stackie Jia <jsq2627@gmail.com>
stackia
marked this pull request as ready for review
September 2, 2026 12:09
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_004e73a7-5678-4e02-81fc-fed1d3998677) |
basedpyright rejected passing _get_location() into stream_get because the helper could return None. Annotate it as str | None and assert the header is present in the playable redirect tests. Co-authored-by: Stackie Jia <jsq2627@gmail.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
Issue #707 describes a catchup/VOD auth helper that HTTP-proxies through rtp2httpd and 302s the player to a real playback URL.
Previously, only
http://Locationvalues were rewritten to/http/.... Absolutertsp://,rtp://, andudp://redirects were forwarded unchanged (and logged asURL must start with http://), so HTTP players could not follow them through rtp2httpd. Root-relative/rtsp/...redirects already worked, but produced the same false error log.This change rewrites
Locationusing the same schemes M3U transform already recognizes:http://host:port/path→/http/host:port/pathrtsp://host:port/path→/rtsp/host:port/pathrtp://addr:port→/rtp/addr:portudp://addr:port→/udp/addr:port/rtsp/...and/rtp/...are forwarded unchanged, without an error loghttps://and other schemes stay unchangedTest plan
Location: rtsp://...is rewritten to/rtsp/...and playableLocation: rtp://.../udp://...is rewritten to/rtp/...//udp/.../rtp/...is playable against multicast/rtsp/...is forwarded unchanged and playableURL must start with http://Closes #707