Skip to content

Commit c0f204e

Browse files
committed
Update routes.rs
1 parent 6223f29 commit c0f204e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/fula-cli/src/routes.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ pub fn create_router(state: Arc<AppState>) -> Router {
3131
// Service endpoints
3232
.route("/", get(handlers::list_buckets))
3333
.route("/", head(handlers::health_check))
34-
// Bucket endpoints
34+
// Bucket endpoints (with and without trailing slash for S3 compatibility)
35+
// Note: We do NOT normalize object keys (/{bucket}/{*key}) as S3 allows keys ending in '/'
3536
.route("/{bucket}", put(handlers::create_bucket))
37+
.route("/{bucket}/", put(handlers::create_bucket))
3638
.route("/{bucket}", delete(handlers::delete_bucket))
39+
.route("/{bucket}/", delete(handlers::delete_bucket))
3740
.route("/{bucket}", head(handlers::head_bucket))
41+
.route("/{bucket}/", head(handlers::head_bucket))
3842
.route("/{bucket}", get(bucket_or_list_handler))
43+
.route("/{bucket}/", get(bucket_or_list_handler))
3944
.route("/{bucket}", post(bucket_post_handler))
45+
.route("/{bucket}/", post(bucket_post_handler))
4046
// Object endpoints
4147
.route("/{bucket}/{*key}", put(object_put_handler))
4248
.route("/{bucket}/{*key}", get(object_get_handler))

0 commit comments

Comments
 (0)