Skip to content

Commit 3aa5ad1

Browse files
Cover non-breaking-space baseURL normalization paths
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent e6e6bee commit 3aa5ad1

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
@@ -918,6 +918,17 @@ describe("TriggerChatTransport", function () {
918918
}).not.toThrow();
919919
});
920920

921+
it("accepts non-breaking-space wrapped baseURL values", function () {
922+
expect(function () {
923+
new TriggerChatTransport({
924+
task: "chat-task",
925+
accessToken: "pk_trigger",
926+
baseURL: "\u00A0https://api.trigger.dev/custom-prefix/\u00A0",
927+
stream: "chat-stream",
928+
});
929+
}).not.toThrow();
930+
});
931+
921932
it("accepts whitespace-wrapped uppercase http protocol in baseURL", function () {
922933
expect(function () {
923934
new TriggerChatTransport({
@@ -3415,6 +3426,17 @@ describe("TriggerChatTransport", function () {
34153426
}).not.toThrow();
34163427
});
34173428

3429+
it("accepts non-breaking-space wrapped baseURL values from factory", function () {
3430+
expect(function () {
3431+
createTriggerChatTransport({
3432+
task: "chat-task",
3433+
accessToken: "pk_trigger",
3434+
baseURL: "\u00A0https://api.trigger.dev/custom-prefix/\u00A0",
3435+
stream: "chat-stream",
3436+
});
3437+
}).not.toThrow();
3438+
});
3439+
34183440
it("accepts uppercase http protocol from factory without throwing", function () {
34193441
expect(function () {
34203442
createTriggerChatTransport({

0 commit comments

Comments
 (0)