mirror of
https://github.com/versity/versitygw.git
synced 2026-03-27 09:54:59 +00:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user