Skip to content

fix(http-proxy): rewrite rtsp:// redirect Location onto /rtsp/ - #739

Merged
stackia merged 3 commits into
mainfrom
cursor/http-rtsp-location-rewrite-626a
Sep 2, 2026
Merged

fix(http-proxy): rewrite rtsp:// redirect Location onto /rtsp/#739
stackia merged 3 commits into
mainfrom
cursor/http-rtsp-location-rewrite-626a

Conversation

@stackia

@stackia stackia commented Sep 2, 2026

Copy link
Copy Markdown
Owner

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:// Location values were rewritten to /http/.... Absolute rtsp://, rtp://, and udp:// redirects were forwarded unchanged (and logged as URL 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 Location using the same schemes M3U transform already recognizes:

  • http://host:port/path/http/host:port/path
  • rtsp://host:port/path/rtsp/host:port/path
  • rtp://addr:port/rtp/addr:port
  • udp://addr:port/udp/addr:port
  • Root-relative values such as /rtsp/... and /rtp/... are forwarded unchanged, without an error log
  • https:// and other schemes stay unchanged

Test plan

  • e2e: Location: rtsp://... is rewritten to /rtsp/... and playable
  • e2e: Location: rtp://... / udp://... is rewritten to /rtp/... / /udp/...
  • e2e: rewritten /rtp/... is playable against multicast
  • e2e: root-relative /rtsp/... is forwarded unchanged and playable
  • e2e: relative Location does not log URL must start with http://

Closes #707

Open in Web Open in Cursor 

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>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Documentation preview

The 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
stackia marked this pull request as ready for review September 2, 2026 12:09
@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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>
@stackia
stackia merged commit 1d13d16 into main Sep 2, 2026
11 checks passed
@stackia
stackia deleted the cursor/http-rtsp-location-rewrite-626a branch September 2, 2026 12:24
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.

HTTP 代理将合法的相对 Location 重定向错误记录为“URL must start with http://”

2 participants