fix: reject empty versionId query parameter in object actions

S3 returns `InvalidArgument` when an object action receives a `versionId` query parameter with no value. The gateway silently treated it as an unversioned request instead.

Added a shared `versionId` validation helper and apply it to the object actions that accept the parameter, so malformed requests are rejected up front rather than reaching the backend.
This commit is contained in:
niksis02
2026-09-10 16:35:05 +04:00
parent be3ec8ba4d
commit 1e0d7b218d
23 changed files with 437 additions and 6 deletions
+5
View File
@@ -20,6 +20,7 @@ import (
"crypto/rand"
"errors"
"fmt"
"net/http"
"strings"
"github.com/aws/aws-sdk-go-v2/service/s3"
@@ -273,3 +274,7 @@ func GetObjectAttributes_checksums(s *S3Conf) error {
return nil
})
}
func GetObjectAttributes_empty_version_id(s *S3Conf) error {
return testEmptyVersionId(s, "GetObjectAttributes_empty_version_id", http.MethodGet, "attributes", nil)
}