An HTTP redirect is a server response that tells a client to request a resource from a different URL. The response includes a status code and a destination, often supplied in a Location header. Browsers, package managers, and other HTTP clients may follow redirects automatically, subject to their own rules.
Redirects are useful for moving content or directing requests to mirrors, but they change where data comes from and can affect security decisions. In attacks, someone able to manipulate unencrypted HTTP traffic may try to steer a client to an attacker-controlled destination. In package downloads, redirect and retry handling must preserve file integrity and ensure the received package is the one the client intended to retrieve. Defenses include using HTTPS, validating package signatures and repository metadata, and keeping clients patched.


