Skip to content

[S3] Treat /{bucket}/ as the bucket, as S3 does #179

Closed

Description

@saworbit

Problem

With path-style addressing, S3 treats /bucket/ the same as /bucket. A trailing slash still addresses the bucket, and no object can have an empty key. Here /{bucket}/ matches neither route: /{bucket} is the bucket and /{bucket}/{*key} needs a non-empty key.

Before #175 those requests got an empty-bodied 404. With #175 they get the NotImplemented fallback:

GET  /b1?list-type=2   -> 200
GET  /b1/?list-type=2  -> 501 <Code>NotImplemented</Code> "GET /b1/ is not implemented"
PUT  /b2/              -> 501
HEAD /b1/              -> 501

Clients and scripts that build bucket URLs with a trailing slash can't list, create or check buckets.

Proposed solution

In crates/protocol-s3/src/server.rs, route /{bucket}/ to the same handlers as /{bucket}: list_objects, create_bucket and head_bucket. Any other method keeps the NotImplemented fallback.

Acceptance criteria

  • GET /b1/, PUT /b2/ and HEAD /b1/ behave exactly like their counterparts without the slash, query parameters included.
  • A test in crates/protocol-s3/tests/http_test.rs covers each one.

Activity

  1. added
    enhancement
    on Nov 13, 2026
  2. saworbit commented on Nov 13, 2026

    @saworbit
    OwnerAuthor

    Fixed in cdb3249 (#181). /{bucket}/ now routes to the same GET, PUT and HEAD handlers as /{bucket}, query parameters included. Other methods still get NotImplemented. Test added. CHANGELOG updated. This closes when #181 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementprotocol-s3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions