Merge pull request #2389 from dualfroz/fix-illegal-location-constraint

Return IllegalLocationConstraintException for a mismatched LocationConstraint
This commit is contained in:
dualfroz committed 2026-09-14 15:03:16 -07:00
1 parent efecf29ac0
commit 1d06fadbbd
6 files changed
+124 -14

No files matched your search

+14
View File
@@ -984,6 +984,20 @@ func GetCopySourceObjectTooLargeErr(limit int64) APIError {
}
}
// Returns illegal location constraint APIError. An empty constraint stands for
// a CreateBucket request that carried no LocationConstraint at all.
func GetIllegalLocationConstraintErr(constraint string) APIError {
if constraint == "" {
constraint = "unspecified"
}
return APIError{
Code: "IllegalLocationConstraintException",
Description: fmt.Sprintf("The %s location constraint is incompatible for the region specific endpoint this request was sent to.", constraint),
HTTPStatusCode: http.StatusBadRequest,
}
}
func GetInvalidRedirectCodeErr(input int) APIError {
return APIError{
Code: "InvalidRequest",