diff options
author | trinity-1686a <trinity.pointard@gmail.com> | 2021-12-06 15:17:47 +0100 |
---|---|---|
committer | Alex <alex@adnab.me> | 2021-12-06 15:17:47 +0100 |
commit | c4ac8835d388b14e144b01599c0f1351bdb9e958 (patch) | |
tree | e2bdb8e9ef34ea01c13ee126728f7adac2642e6a /src/api/s3_put.rs | |
parent | ccce75bc25a2827e23443ec65ceb6b409f4a55ae (diff) | |
download | garage-c4ac8835d388b14e144b01599c0f1351bdb9e958.tar.gz garage-c4ac8835d388b14e144b01599c0f1351bdb9e958.zip |
add proper request router for s3 api (#163)
fix #161
Current request router was organically grown, and is getting messier and messier with each addition.
This router cover exaustively existing API endpoints (with exceptions listed in [#161(comment)](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/161#issuecomment-1773) either because new and old api endpoint can't feasabily be differentied, or it's more lambda than s3).
Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/163
Reviewed-by: Alex <alex@adnab.me>
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
Diffstat (limited to 'src/api/s3_put.rs')
-rw-r--r-- | src/api/s3_put.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/api/s3_put.rs b/src/api/s3_put.rs index 5eae3bf5..f63e8307 100644 --- a/src/api/s3_put.rs +++ b/src/api/s3_put.rs @@ -354,15 +354,10 @@ pub async fn handle_put_part( req: Request<Body>, bucket: &str, key: &str, - part_number_str: &str, + part_number: u64, upload_id: &str, content_sha256: Option<Hash>, ) -> Result<Response<Body>, Error> { - // Check parameters - let part_number = part_number_str - .parse::<u64>() - .ok_or_bad_request("Invalid part number")?; - let version_uuid = decode_upload_id(upload_id)?; let content_md5 = match req.headers().get("content-md5") { |