From 90e240d23f1d40de371a651915b546ca15b18558 Mon Sep 17 00:00:00 2001 From: niksis02 Date: Wed, 1 Apr 2026 16:21:07 +0400 Subject: [PATCH 1/2] fix: change ErrMissingDateHeader http status code to 403 Fixes #1934 The HTTP status code for `ErrMissingDateHeader` was `400`. Now it's changed to correct `403`. --- s3err/s3err.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3err/s3err.go b/s3err/s3err.go index 92586aab..a0fb2cb5 100644 --- a/s3err/s3err.go +++ b/s3err/s3err.go @@ -527,7 +527,7 @@ var errorCodeResponse = map[ErrorCode]APIError{ ErrMissingDateHeader: { Code: "AccessDenied", Description: "AWS authentication requires a valid Date or x-amz-date header.", - HTTPStatusCode: http.StatusBadRequest, + HTTPStatusCode: http.StatusForbidden, }, ErrGetUploadsWithKey: { Code: "InvalidRequest", From 6b931909225af9ec7e182e1baa5961f1c382ebc7 Mon Sep 17 00:00:00 2001 From: Luke McCrone Date: Wed, 1 Apr 2026 15:13:58 -0300 Subject: [PATCH 2/2] test: fix response code --- tests/test_rest_list_buckets.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rest_list_buckets.sh b/tests/test_rest_list_buckets.sh index ddd49761..45bb943e 100755 --- a/tests/test_rest_list_buckets.sh +++ b/tests/test_rest_list_buckets.sh @@ -232,7 +232,7 @@ export RUN_USERS=true } @test "REST - ListBuckets - error Content-Type is application/xml" { - run send_rest_go_command_check_header_key_and_value "400" "Content-Type" "application/xml" "-method" "GET" "-omitDate" + run send_rest_go_command_check_header_key_and_value "403" "Content-Type" "application/xml" "-method" "GET" "-omitDate" assert_success }