P2: Fix S3 multipart route - use query param for action
- Change route from /s3/multipart/:bucket/*key/init to /s3/multipart/:bucket/*key?action=init - Add multipart_handler to unify all multipart operations - Use Response type instead of impl IntoResponse for type compatibility
This commit is contained in:
@@ -245,11 +245,12 @@ pub async fn run(port: u16, file: Option<String>) -> anyhow::Result<()> {
|
||||
.post(crate::s3::put_object) // POST for uploads (same handler handles multipart detection)
|
||||
.delete(crate::s3::delete_object)
|
||||
)
|
||||
// Multipart upload endpoints
|
||||
.route("/s3/multipart/:bucket/*key/init", post(crate::s3::initiate_multipart_upload))
|
||||
.route("/s3/multipart/:bucket/*key/part", put(crate::s3::upload_part))
|
||||
.route("/s3/multipart/:bucket/*key/complete", post(crate::s3::complete_multipart_upload))
|
||||
.route("/s3/multipart/:bucket/*key/abort", delete(crate::s3::abort_multipart_upload))
|
||||
// Multipart upload endpoints (use query param for action)
|
||||
.route("/s3/multipart/:bucket/*key",
|
||||
post(crate::s3::multipart_handler)
|
||||
.put(crate::s3::multipart_handler)
|
||||
.delete(crate::s3::multipart_handler)
|
||||
)
|
||||
// Bucket policy endpoints
|
||||
.route("/s3/policy/:bucket", get(crate::s3::get_bucket_policy))
|
||||
.route("/s3/policy/:bucket", put(crate::s3::put_bucket_policy))
|
||||
|
||||
Reference in New Issue
Block a user