You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
S3 appears to have a somewhat perverse behaviour when a request is made to a bucket in the wrong region, specifically it returns a 301 redirect missing a LOCATION header. FWIW this appears to be in contravention of the HTTP specification - https://www.rfc-editor.org/rfc/rfc2616#section-10.3.2.
As this is missing a LOCATION header, it fails to trigger the redirect logic here which causes it to consider this a "valid" request. I'm not sure can be considered an upstream bug, as for its purposes it is unclear what the correct behaviour for redirects that aren't actually redirects is 😅.
reqwest::error_for_status_by_ref then treats this response as not an error. Normally failed redirects would result in an error higher up, but as this response lacks a LOCATION header, reqwest doesn't consider it a well-formed redirect
The result is that:
Requests with no response body will "succeed" - despite not doing anything
Requests with a response body will likely fail to parse correctly
To Reproduce
Configure an S3 integration test with the wrong region
Expected behavior
We should return an error clearly indicating what has gone wrong
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
S3 appears to have a somewhat perverse behaviour when a request is made to a bucket in the wrong region, specifically it returns a 301 redirect missing a LOCATION header. FWIW this appears to be in contravention of the HTTP specification - https://www.rfc-editor.org/rfc/rfc2616#section-10.3.2.
As this is missing a LOCATION header, it fails to trigger the redirect logic here which causes it to consider this a "valid" request. I'm not sure can be considered an upstream bug, as for its purposes it is unclear what the correct behaviour for redirects that aren't actually redirects is 😅.
reqwest::error_for_status_by_ref then treats this response as not an error. Normally failed redirects would result in an error higher up, but as this response lacks a LOCATION header, reqwest doesn't consider it a well-formed redirect
The result is that:
To Reproduce
Configure an S3 integration test with the wrong region
Expected behavior
We should return an error clearly indicating what has gone wrong
Additional context
The text was updated successfully, but these errors were encountered: