1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-07-05 05:40:31 +02:00

[#6654] fixed S3 canonical uri parts escaping

This commit is contained in:
Gani Georgiev
2025-03-28 19:28:04 +02:00
parent d68786df9c
commit b5be7f2d3c
8 changed files with 201 additions and 26 deletions

View File

@ -99,29 +99,39 @@ func TestDriverNormilizeError(t *testing.T) {
errors.New("test"),
false,
},
{
"response error with only status (non-404)",
&s3.ResponseError{Status: 123},
false,
},
{
"response error with only status (404)",
&s3.ResponseError{Status: 404},
true,
},
{
"response error with custom code",
s3.ResponseError{Code: "test"},
&s3.ResponseError{Code: "test"},
false,
},
{
"response error with NoSuchBucket code",
s3.ResponseError{Code: "NoSuchBucket"},
&s3.ResponseError{Code: "NoSuchBucket"},
true,
},
{
"response error with NoSuchKey code",
s3.ResponseError{Code: "NoSuchKey"},
&s3.ResponseError{Code: "NoSuchKey"},
true,
},
{
"response error with NotFound code",
s3.ResponseError{Code: "NotFound"},
&s3.ResponseError{Code: "NotFound"},
true,
},
{
"wrapped response error with NotFound code", // ensures that the entire error's tree is checked
fmt.Errorf("test: %w", s3.ResponseError{Code: "NotFound"}),
fmt.Errorf("test: %w", &s3.ResponseError{Code: "NotFound"}),
true,
},
{