fix: webui pass correct arguments to request() in putBucketPolicy

The fifth parameter of request() is useAdminEndpoint (boolean), but
putBucketPolicy was passing a Content-Type header object instead.
This caused useAdminEndpoint to be truthy and contentType to default
to 'application/xml' instead of 'application/json'.

Fixed by passing false for useAdminEndpoint and 'application/json'
as the contentType argument.

Fixes #1928
This commit is contained in:
Ben McClelland
2026-03-04 10:32:52 -08:00
parent 703baeeed4
commit 07c970e3fe

View File

@@ -1846,9 +1846,7 @@ ${tagsXml}
*/
async putBucketPolicy(bucket, policy) {
const policyJson = JSON.stringify(policy);
await this.request('PUT', `/${bucket}`, { policy: '' }, policyJson, {
'Content-Type': 'application/json'
});
await this.request('PUT', `/${bucket}`, { policy: '' }, policyJson, false, 'application/json');
}
/**