Skip to content

Stop adding Referer headers to installer redirects - #53

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
Devolutions:masterfrom
theKBro:fix/issue-50-sourceforge-redirect
Oct 19, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
Devolutions:masterfrom
theKBro:fix/issue-50-sourceforge-redirect

Conversation

@theKBro

Copy link
Copy Markdown
Contributor

Disables Reqwest's automatic redirect Referer header for Rust installer downloads, matching .NET's redirect behavior. SourceForge treats requests with that header as browser navigation and can return an HTML landing page instead of redirecting to the installer.

The fix and regression coverage are Rust-only. .NET already behaves correctly and is unchanged.

Regression coverage

  • download_installer_follows_redirect_and_verifies_final_bytes exercises the Rust core library through a local HTTP server. The redirected endpoint returns HTML if a Referer header is present; successful download and hash verification therefore require redirects without that header.
  • default_reqwest_redirect_referer_receives_html_instead_of_installer reproduces the failure with Reqwest's default settings against the same local HTTP fixture, showing a successful HTTP response containing HTML rather than the expected installer bytes.
  • download_installer_omits_referer_across_multiple_redirects_and_hosts covers a five-hop 301/302/303/307/308 redirect chain to another server. It checks the original URL is requested without rewriting, the final hash matches, and the original installer filename is preserved.
  • download_installer_rejects_hash_mismatch_after_redirect ensures redirected downloads still fail when the final bytes do not match the manifest SHA-256.

Related issue

Fixes #50.

theKBro (theKBro) and others added 2 commits October 7, 2026 10:33
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 9d384c3 into Devolutions:master Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Handle SourceForge installer URLs that return HTML instead of the installer

2 participants