Skip to content

Commit 842d83b

Browse files
Cover mongolian separator precedence in mixed-invalid baseURLs
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 28becff commit 842d83b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ Examples of ordering:
734734
- `https://user:pass@example.com?x=1``baseURL must not include query parameters or hash fragments`
735735
- `ftp://user:pass@example.com/in valid?x=1``baseURL must not contain internal whitespace characters`
736736
- `ftp://user:pass@example.com/\u2060invalid?x=1#fragment``baseURL must not contain internal whitespace characters`
737+
- `ftp://user:pass@example.com/\u180Einvalid?x=1#fragment``baseURL must not contain internal whitespace characters`
737738

738739
For richer TypeScript ergonomics in app code, `@trigger.dev/ai` also exports:
739740

packages/ai/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ Examples of ordering:
241241
- `https://user:pass@example.com?x=1``baseURL must not include query parameters or hash fragments`
242242
- `ftp://user:pass@example.com/in valid?x=1``baseURL must not contain internal whitespace characters`
243243
- `ftp://user:pass@example.com/\u2060invalid?x=1#fragment``baseURL must not contain internal whitespace characters`
244+
- `ftp://user:pass@example.com/\u180Einvalid?x=1#fragment``baseURL must not contain internal whitespace characters`
244245

245246
## `ai.tool(...)` example
246247

packages/ai/src/chatTransport.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,17 @@ describe("TriggerChatTransport", function () {
13241324
}).toThrowError("baseURL must not contain internal whitespace characters");
13251325
});
13261326

1327+
it("prioritizes mongolian-vowel-separator validation over protocol/query/hash/credential validation", function () {
1328+
expect(function () {
1329+
new TriggerChatTransport({
1330+
task: "chat-task",
1331+
accessToken: "pk_trigger",
1332+
baseURL: "ftp://user:pass@example.com/\u180Einvalid?query=1#fragment",
1333+
stream: "chat-stream",
1334+
});
1335+
}).toThrowError("baseURL must not contain internal whitespace characters");
1336+
});
1337+
13271338
it("prioritizes query/hash validation over credential validation", function () {
13281339
expect(function () {
13291340
new TriggerChatTransport({
@@ -4428,6 +4439,17 @@ describe("TriggerChatTransport", function () {
44284439
}).toThrowError("baseURL must not contain internal whitespace characters");
44294440
});
44304441

4442+
it("prioritizes mongolian-vowel-separator validation over protocol/query/hash/credential validation in factory", function () {
4443+
expect(function () {
4444+
createTriggerChatTransport({
4445+
task: "chat-task",
4446+
accessToken: "pk_trigger",
4447+
baseURL: "ftp://user:pass@example.com/\u180Einvalid?query=1#fragment",
4448+
stream: "chat-stream",
4449+
});
4450+
}).toThrowError("baseURL must not contain internal whitespace characters");
4451+
});
4452+
44314453
it("prioritizes query/hash validation over credential validation in factory", function () {
44324454
expect(function () {
44334455
createTriggerChatTransport({

0 commit comments

Comments
 (0)