Skip to content

Commit

Permalink
avoid running Object.keys on Buffer objects, to avoid unnecessary m…
Browse files Browse the repository at this point in the history
…emory usage
  • Loading branch information
netroy committed Apr 28, 2023
1 parent b30c37b commit deadebf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nodes-base/credentials/Aws.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';
import { isObjectEmpty } from 'n8n-workflow';
import type { OptionsWithUri } from 'request';

export const regions = [
Expand Down Expand Up @@ -353,7 +354,7 @@ export class Aws implements ICredentialType {
});
}

if (body && Object.keys(body).length === 0) {
if (body && !isObjectEmpty(body)) {
body = '';
}

Expand Down

0 comments on commit deadebf

Please sign in to comment.