Skip to content

Commit

Permalink
feat: removing user-agent header from constructed curl
Browse files Browse the repository at this point in the history
  • Loading branch information
Varun0157 committed Jun 14, 2024
1 parent 513dbb7 commit 2963ffe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/constructCurl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2963ffe

Please sign in to comment.