mirror of
https://github.com/rclone/rclone.git
synced 2026-10-10 15:01:37 -04:00
The headers set with --header and --header-download are added to every request by the rclone transport, including redirect hops which net/http makes to other hosts, so a credential passed with --header for one host could be sent to any host that server chose to redirect to. The transport now walks the redirect chain net/http records on each redirected request and, once the chain has visited a host other than the one originally requested, removes the headers rather than adding them. Also restore the global --client-cert and --client-key config after TestCertificates so its temporary files are not used by later tests. (cherry picked from commit 101c3e342c86ae65c7c743474d7319330f0eb0ca)