Skip to content

Automatically follow redirects

In Short

This patch adds functionality to automatically follow redirects for all HTTP 3xx codes, following up to 20 redirects. This information is currently not cached as the redirect path of a repo may change over time

Rationale

Currently Repositories added via fdroidrepo:// URL automatically get a http:// URL, but the HttpDownloader does not follow redirects. This makes it hard, if not impossible, to allow users to easily add repositories (e.g. via QR code or direct link) to F-Droid that use HTTPS.

Impact

Using redirected URLs, or ones that redirect in a loop, may lead to lower performance while updating repositories. In the future, depending on real-world impact, caching the redirected URL may be desired.

Future Work

Currently, the HttpDownloader also does not follow HSTS in any reasonable way, and does not use the HSTS Preload lists. This may be a desirable feature in the future.

Merge request reports