Skip to content

Commit 4d19dec

Browse files
authored
fix: add user-agent to the websocket request (#1584)
1 parent 76a5ac2 commit 4d19dec

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/pretty-squids-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
fix: add user-agent to the websocket request

packages/cli-v3/src/dev/workerRuntime.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { logger } from "../utilities/logger.js";
2626
import { resolveSourceFiles } from "../utilities/sourceFiles.js";
2727
import { BackgroundWorker, BackgroundWorkerCoordinator } from "./backgroundWorker.js";
2828
import { sanitizeEnvVars } from "../utilities/sanitizeEnvVars.js";
29+
import { VERSION } from "../version.js";
2930

3031
export interface WorkerRuntime {
3132
shutdown(): Promise<void>;
@@ -325,7 +326,13 @@ class DevWorkerRuntime implements WorkerRuntime {
325326
function WebsocketFactory(apiKey: string) {
326327
return class extends wsWebSocket {
327328
constructor(address: string | URL, options?: ClientOptions | ClientRequestArgs) {
328-
super(address, { ...(options ?? {}), headers: { Authorization: `Bearer ${apiKey}` } });
329+
super(address, {
330+
...(options ?? {}),
331+
headers: {
332+
Authorization: `Bearer ${apiKey}`,
333+
"User-Agent": `trigger.dev-cli/${VERSION}`,
334+
},
335+
});
329336
}
330337
};
331338
}

0 commit comments

Comments
 (0)