Skip to content

Commit

Permalink
Merge pull request #21 from agrostar/#19_user-agent
Browse files Browse the repository at this point in the history
removing user-agent header from curl requests
  • Loading branch information
Varun0157 authored Jul 6, 2024
2 parents b12c19b + 6572c2c commit 95c47a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/reformatRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function formatAndReplaceVars(
curlReq?: boolean,
): string[] {
const autoHeaders: { [key: string]: string } = {};
autoHeaders["user-agent"] = "zzAPI-vscode/" + extensionVersion;
if (!curlReq) autoHeaders["user-agent"] = "zzAPI-vscode/" + extensionVersion;

if (request.httpRequest.body && typeof request.httpRequest.body == "object")
autoHeaders["content-type"] = "application/json";
request.httpRequest.headers = Object.assign(autoHeaders, request.httpRequest.headers);
Expand Down

0 comments on commit 95c47a3

Please sign in to comment.