Skip to content

Commit 4432ba4

Browse files
Cover wrapped percent-encoded delimiter baseURL paths
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 666b991 commit 4432ba4

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
@@ -1017,6 +1017,17 @@ describe("TriggerChatTransport", function () {
10171017
}).not.toThrow();
10181018
});
10191019

1020+
it("accepts wrapper-whitespace around percent-encoded query/hash markers", function () {
1021+
expect(function () {
1022+
new TriggerChatTransport({
1023+
task: "chat-task",
1024+
accessToken: "pk_trigger",
1025+
baseURL: " https://api.trigger.dev/custom%3Fprefix%23segment/// ",
1026+
stream: "chat-stream",
1027+
});
1028+
}).not.toThrow();
1029+
});
1030+
10201031
it("accepts whitespace-wrapped uppercase http protocol in baseURL", function () {
10211032
expect(function () {
10221033
new TriggerChatTransport({
@@ -3613,6 +3624,17 @@ describe("TriggerChatTransport", function () {
36133624
}).not.toThrow();
36143625
});
36153626

3627+
it("accepts wrapper-whitespace around percent-encoded query/hash markers from factory", function () {
3628+
expect(function () {
3629+
createTriggerChatTransport({
3630+
task: "chat-task",
3631+
accessToken: "pk_trigger",
3632+
baseURL: " https://api.trigger.dev/custom%3Fprefix%23segment/// ",
3633+
stream: "chat-stream",
3634+
});
3635+
}).not.toThrow();
3636+
});
3637+
36163638
it("accepts uppercase http protocol from factory without throwing", function () {
36173639
expect(function () {
36183640
createTriggerChatTransport({

0 commit comments

Comments
 (0)