mirror of
https://github.com/rclone/rclone.git
synced 2026-09-23 06:15:42 -04:00
s3: remove session token on cross-host redirects
Add a redirect policy to the S3 HTTP client so X-Amz-Security-Token is removed once a redirect chain crosses hosts. Keep stripping it on later same-host hops in the same chain, since net/http copies headers from the initial request for each redirect and can otherwise restore the token. Preserve same-host redirect behavior, retain the standard redirect limit, and add tests for cross-host, same-host, multi-hop, and redirect-loop cases.
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f