Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Erratic Behaviour if Incorrect S3 Region Configured #224

Copy link
Copy link

Description

@tustvold
Issue body actions

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:

  • 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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.