Fix Torznab/Prowlarr download URL rewrite to avoid proxy double-wrapping on host aliases#647
Fix Torznab/Prowlarr download URL rewrite to avoid proxy double-wrapping on host aliases#647Copilot wants to merge 2 commits into
Conversation
|
|
/deploy tag=Prowlarr-host-rewrite |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76f6b4f2cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isProwlarrProxyUrl = | ||
| /^\/\d+\/download\/?$/i.test(linkUrl.pathname) && linkUrl.searchParams.has("link"); |
There was a problem hiding this comment.
Restrict proxy detection before skipping wrapping
When a Prowlarr-backed indexer returns a raw external download URL whose path happens to match /<digits>/download and includes a link query parameter, this new check classifies it as an existing Prowlarr proxy solely from the path/query. In that case Questarr rewrites the host to Prowlarr but skips the code that base64-wraps the original URL and adds the configured apikey, so downloads from trackers using that URL shape are sent to Prowlarr as malformed proxy requests instead of the intended raw external URL. The guard should also verify that the returned URL is actually from the configured Prowlarr host/known alias (and ideally the same indexer id) before taking this branch.
Useful? React with 👍 / 👎.



Questarr started failing all torrent downloads after the Torznab rewrite logic began re-wrapping Prowlarr download links. When Prowlarr returned its own proxy URL but the hostname differed by alias (
localhostvs127.0.0.1), Questarr produced a doubly wrappedlinkparameter that Prowlarr rejected.Torznab rewrite guard for existing Prowlarr proxy links
server/torznab.ts, for Prowlarr-style indexers (/{id}/api):/{id}/downloadwithlinkquery param), Questarr now rewrites only protocol/host to the configured indexer URL.Regression coverage for hostname alias case
server/__tests__/torznab.test.tsto cover:localhost127.0.0.1linkpayload (no double-wrap).