Skip to content

Commit 7d3eac2

Browse files
Cover whitespace-wrapped uppercase HTTP baseURL acceptance
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 9863544 commit 7d3eac2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/ai/src/chatTransport.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,17 @@ describe("TriggerChatTransport", function () {
818818
}).not.toThrow();
819819
});
820820

821+
it("accepts whitespace-wrapped uppercase http protocol in baseURL", function () {
822+
expect(function () {
823+
new TriggerChatTransport({
824+
task: "chat-task",
825+
accessToken: "pk_trigger",
826+
baseURL: " HTTP://api.trigger.dev/custom-prefix/// ",
827+
stream: "chat-stream",
828+
});
829+
}).not.toThrow();
830+
});
831+
821832
it("accepts uppercase http protocol in baseURL", async function () {
822833
let observedTriggerPath: string | undefined;
823834
let observedStreamPath: string | undefined;
@@ -3211,6 +3222,17 @@ describe("TriggerChatTransport", function () {
32113222
}).not.toThrow();
32123223
});
32133224

3225+
it("accepts whitespace-wrapped uppercase http protocol from factory without throwing", function () {
3226+
expect(function () {
3227+
createTriggerChatTransport({
3228+
task: "chat-task",
3229+
accessToken: "pk_trigger",
3230+
baseURL: " HTTP://api.trigger.dev/custom-prefix/// ",
3231+
stream: "chat-stream",
3232+
});
3233+
}).not.toThrow();
3234+
});
3235+
32143236
it("continues streaming when onTriggeredRun callback throws", async function () {
32153237
let callbackCalled = false;
32163238
const errors: TriggerChatTransportError[] = [];

0 commit comments

Comments
 (0)