diff options
author | Alex <alex@adnab.me> | 2022-10-18 14:20:44 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-10-18 14:20:44 +0000 |
commit | 5670599372f6c3c60dcd74279a0741248fc510c3 (patch) | |
tree | 2852a5e3cf2a0d1728b7d67e59e1b13aaae92287 /src/garage/tests/s3 | |
parent | 7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae (diff) | |
parent | f1c96d108c29ae4ef7b1f7ed8f2c06b6a5744909 (diff) | |
download | garage-5670599372f6c3c60dcd74279a0741248fc510c3.tar.gz garage-5670599372f6c3c60dcd74279a0741248fc510c3.zip |
Merge pull request 'Use status code 204 No Content for empty responses' (#403) from tobikris/garage:http-no-content into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/403
Diffstat (limited to 'src/garage/tests/s3')
-rw-r--r-- | src/garage/tests/s3/website.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/garage/tests/s3/website.rs b/src/garage/tests/s3/website.rs index 0570ac6a..244a2fa0 100644 --- a/src/garage/tests/s3/website.rs +++ b/src/garage/tests/s3/website.rs @@ -4,7 +4,7 @@ use aws_sdk_s3::{ model::{CorsConfiguration, CorsRule, ErrorDocument, IndexDocument, WebsiteConfiguration}, types::ByteStream, }; -use http::Request; +use http::{Request, StatusCode}; use hyper::{ body::{to_bytes, Body}, Client, @@ -43,7 +43,7 @@ async fn test_website() { let mut resp = client.request(req()).await.unwrap(); - assert_eq!(resp.status(), 404); + assert_eq!(resp.status(), StatusCode::NOT_FOUND); assert_ne!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY.as_ref() @@ -56,7 +56,7 @@ async fn test_website() { .expect_success_status("Could not allow website on bucket"); resp = client.request(req()).await.unwrap(); - assert_eq!(resp.status(), 200); + assert_eq!(resp.status(), StatusCode::OK); assert_eq!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY.as_ref() @@ -69,7 +69,7 @@ async fn test_website() { .expect_success_status("Could not deny website on bucket"); resp = client.request(req()).await.unwrap(); - assert_eq!(resp.status(), 404); + assert_eq!(resp.status(), StatusCode::NOT_FOUND); assert_ne!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY.as_ref() @@ -175,7 +175,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 200); + assert_eq!(resp.status(), StatusCode::OK); assert_eq!( resp.headers().get("access-control-allow-origin").unwrap(), "*" @@ -200,7 +200,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 404); + assert_eq!(resp.status(), StatusCode::NOT_FOUND); assert_eq!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY_ERR.as_ref() @@ -220,7 +220,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 200); + assert_eq!(resp.status(), StatusCode::OK); assert_eq!( resp.headers().get("access-control-allow-origin").unwrap(), "*" @@ -244,7 +244,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 403); + assert_eq!(resp.status(), StatusCode::FORBIDDEN); assert_ne!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY.as_ref() @@ -285,7 +285,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 403); + assert_eq!(resp.status(), StatusCode::FORBIDDEN); assert_ne!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY.as_ref() @@ -311,7 +311,7 @@ async fn test_website_s3_api() { let mut resp = client.request(req).await.unwrap(); - assert_eq!(resp.status(), 404); + assert_eq!(resp.status(), StatusCode::NOT_FOUND); assert_ne!( to_bytes(resp.body_mut()).await.unwrap().as_ref(), BODY_ERR.as_ref() |