From 1effcaebf23e83188d4836693428f1953d0403be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Louren=C3=A7o?= Date: Thu, 29 Feb 2024 09:25:15 -0300 Subject: [PATCH] refactor(response-stream): avoid creating object on log while parsing headers --- src/network/response-stream.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/network/response-stream.ts b/src/network/response-stream.ts index 52d06188..3e46985f 100644 --- a/src/network/response-stream.ts +++ b/src/network/response-stream.ts @@ -113,9 +113,12 @@ export class ServerlessStreamResponse extends ServerResponse { endHeaderIndex, ); const headers = parseHeaders(headerData); - log.debug('SERVERLESS_ADAPTER:RESPONSE_STREAM:FRAMEWORK_HEADERS', { - headers, - }); + log.debug( + 'SERVERLESS_ADAPTER:RESPONSE_STREAM:FRAMEWORK_HEADERS', + () => ({ + headers, + }), + ); writesToIgnore = 1; internalWritable = onReceiveHeaders(status, headers);