mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 20:55:41 +00:00
fix: awsv4 signature error bug (#5099)
This commit is contained in:
@@ -426,7 +426,7 @@ const prepareRequest = async (item, collection = {}, abortController) => {
|
||||
}
|
||||
|
||||
// if the mode is 'none' then set the content-type header to false. #1693
|
||||
if (request.body.mode === 'none') {
|
||||
if (request.body.mode === 'none' && request.auth.mode !== 'awsv4') {
|
||||
if(!contentTypeDefined) {
|
||||
axiosRequest.headers['content-type'] = false;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ describe('prepare-request: prepareRequest', () => {
|
||||
|
||||
describe.each(['POST', 'PUT', 'PATCH'])('POST request with no body', (method) => {
|
||||
it('Should set content-type header to false if method is ' + method + ' and there is no data in the body', async () => {
|
||||
const request = { method: method, url: 'test-domain', body: { mode: 'none' } };
|
||||
const request = { method: method, url: 'test-domain', body: { mode: 'none' }, auth: { mode: 'none' } };
|
||||
const result = await prepareRequest({ request, collection: { pathname: '' } });
|
||||
expect(result.headers['content-type']).toEqual(false);
|
||||
});
|
||||
@@ -71,7 +71,8 @@ describe('prepare-request: prepareRequest', () => {
|
||||
method: method,
|
||||
url: 'test-domain',
|
||||
body: { mode: 'none' },
|
||||
headers: [{ name: 'content-type', value: 'application/json', enabled: true }]
|
||||
headers: [{ name: 'content-type', value: 'application/json', enabled: true }],
|
||||
auth: { mode: 'none' }
|
||||
};
|
||||
const result = await prepareRequest({ request, collection: { pathname: '' } });
|
||||
expect(result.headers['content-type']).toEqual('application/json');
|
||||
|
||||
Reference in New Issue
Block a user