Skip to content

Commit 9b8cec2

Browse files
committed
feat: include user agent in headers
this will be helpful in the future for debugging customer issues since it will tell us what version of the plugins (at least the bundler core) they're using
1 parent 866e31a commit 9b8cec2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/bundler-plugin-core/src/utils/__tests__/Output.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ describe("Output", () => {
693693
headers: new Headers({
694694
Authorization: "token token",
695695
"Content-Type": "application/json",
696+
"User-Agent": "codecov-bundler_plugin/1.9.1",
696697
}),
697698
body: JSON.stringify({
698699
branch: "main",

packages/bundler-plugin-core/src/utils/getPreSignedURL.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
type Span,
88
} from "@sentry/core";
99
import { z } from "zod";
10+
import { version } from "../../package.json" with { type: "json" };
1011
import { FailedFetchError } from "../errors/FailedFetchError.ts";
1112
import { UploadLimitReachedError } from "../errors/UploadLimitReachedError.ts";
1213
import { type ProviderServiceParams } from "../types.ts";
@@ -53,6 +54,7 @@ export const getPreSignedURL = async ({
5354
}: GetPreSignedURLArgs) => {
5455
const headers = new Headers({
5556
"Content-Type": "application/json",
57+
"User-Agent": `codecov-bundler_plugin/${version}`,
5658
});
5759

5860
const requestBody: RequestBody = serviceParams;

0 commit comments

Comments
 (0)