From 2963ffe9056f5f08c0df10338f80c238008366ff Mon Sep 17 00:00:00 2001 From: Varun0157 Date: Fri, 14 Jun 2024 18:03:50 +0530 Subject: [PATCH] feat: removing user-agent header from constructed curl --- src/constructCurl.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/constructCurl.ts b/src/constructCurl.ts index 594b4a5..cb64c38 100644 --- a/src/constructCurl.ts +++ b/src/constructCurl.ts @@ -11,8 +11,10 @@ export function getCurlRequest(request: RequestSpec): string { // headers if (request.httpRequest.headers !== undefined) { - for (const header in request.httpRequest.headers) - curl += ` -H '${header}: ${request.httpRequest.headers[header]}'`; + for (const header in request.httpRequest.headers) { + if (header === "user-agent") continue; + curl += ` -H \"${header}: ${request.httpRequest.headers[header]}\"`; + } } // body