Cover zero-width-non-joiner wrapper baseURL rejection

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 06:18:46 +00:00
parent 9fa12b045b
commit 140fc20e49
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -671,6 +671,7 @@ Examples:
- ✅ `\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
- ❌ `\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
- ❌ `\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)
- ❌ `\u200Chttps://api.trigger.dev/custom-prefix/\u200C` (zero-width-non-joiner wrappers are rejected)
- ❌ `https://api.trigger.dev?foo=bar`
- ❌ `https://api.trigger.dev#fragment`
- ❌ `https://user:pass@api.trigger.dev`
+1
View File
@@ -178,6 +178,7 @@ Examples:
-`\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
-`\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
-`\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)
-`\u200Chttps://api.trigger.dev/custom-prefix/\u200C` (zero-width-non-joiner wrappers are rejected)
-`https://api.trigger.dev?foo=bar` (query string)
-`https://api.trigger.dev#fragment` (hash fragment)
-`https://user:pass@api.trigger.dev` (credentials)
+22
View File
@@ -852,6 +852,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not contain internal whitespace characters");
});
it("throws when baseURL is wrapped with zero-width-non-joiner characters", function () {
expect(function () {
new TriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: "\u200Chttps://api.trigger.dev/custom-prefix/\u200C",
stream: "chat-stream",
});
}).toThrowError("baseURL must not contain internal whitespace characters");
});
it("throws when baseURL contains internal zero-width-non-joiner characters", function () {
expect(function () {
new TriggerChatTransport({
@@ -3646,6 +3657,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not contain internal whitespace characters");
});
it("throws from factory when baseURL is wrapped with zero-width-non-joiner characters", function () {
expect(function () {
createTriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: "\u200Chttps://api.trigger.dev/custom-prefix/\u200C",
stream: "chat-stream",
});
}).toThrowError("baseURL must not contain internal whitespace characters");
});
it("throws from factory when baseURL contains internal zero-width-non-joiner characters", function () {
expect(function () {
createTriggerChatTransport({