Skip to content

addtorrent: redirect an upload relatively unless a public base is set - #3534

Open
xirvik wants to merge 1 commit into
Novik:masterfrom
xirvik:addtorrent-relative-redirect
Open

xirvik wants to merge 1 commit into
Novik:masterfrom
xirvik:addtorrent-relative-redirect

Conversation

@xirvik

@xirvik xirvik commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Since 5.3.19 the redirect that answers an upload named an absolute URL built from the scheme PHP sees and the Host header. Behind a proxy that terminates TLS without sending X-Forwarded-Proto, that was http:// on an https:// page: the browser refused the upload frame's navigation, the frame could not be read, and a torrent that had been added was reported as "Failed to add torrent." (#3533).

A relative Location resolves against the URL the browser posted to, so it keeps the scheme, host and path prefix the browser used. It is now the target unless RU_PUBLIC_URL or $publicURL is configured, which still decides it. Requests::configuredPublicBaseURL() is split out of publicBaseURL() for that; the feeds links are unchanged.

Since 5.3.19 the redirect that answers an upload named an absolute URL
built from the scheme PHP sees and the Host header. Behind a proxy that
terminates TLS without sending X-Forwarded-Proto, that was http:// on
an https:// page: the browser refused the upload frame's navigation,
the frame could not be read, and a torrent that had been added was
reported as "Failed to add torrent." (Novik#3533).

A relative Location resolves against the URL the browser posted to, so
it keeps the scheme, host and path prefix the browser used. It is now
the target unless RU_PUBLIC_URL or $publicURL is configured, which
still decides it. Requests::configuredPublicBaseURL() is split out of
publicBaseURL() for that; the feeds links are unchanged.
@xirvik xirvik mentioned this pull request Nov 10, 2026
4 tasks done
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