From c07ffdc315051e9e6112485f1f09e560be772dfb Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Wed, 21 Oct 2026 17:51:16 +0200 Subject: [PATCH] fix(webui): send the LocationConstraint when creating a bucket outside us-east-1 CreateBucket was sent with an empty body, so on a gateway with any region other than us-east-1 both the bucket dialog and the explorer failed with IllegalLocationConstraintException. Send a CreateBucketConfiguration naming the signing region, which the gateway requires to be its own, for the S3 and the admin create-bucket call alike. Co-Authored-By: Claude Opus 5.5 --- webui/web/js/api.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/webui/web/js/api.js b/webui/web/js/api.js index 9ca59121..f8f87d7d 100644 --- a/webui/web/js/api.js +++ b/webui/web/js/api.js @@ -1211,7 +1211,7 @@ class VersityAPI { 'PATCH', `/${bucketName}/create`, {}, - '', + this.createBucketConfiguration(), true, // useAdminEndpoint 'application/xml', headers @@ -1249,13 +1249,29 @@ class VersityAPI { 'PUT', `/${bucketName}`, {}, - '', + this.createBucketConfiguration(), false, 'application/xml', headers ); } + /** + * CreateBucketConfiguration body for CreateBucket. us-east-1 is the global + * endpoint and takes no LocationConstraint; any other region requires one + * naming it. The gateway only accepts CreateBucket signed for its own + * region, so the signing region is the one to name. + */ + createBucketConfiguration() { + if (!this.region || this.region === 'us-east-1') { + return ''; + } + return ` + + ${this.escapeXml(this.region)} +`; + } + /** * Delete a bucket (S3 DeleteBucket) */