Cover line-separator baseURL whitespace validation
Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
@@ -682,6 +682,7 @@ Examples:
|
||||
- ❌ `https://api.trigger.dev/\rinternal`
|
||||
- ❌ `https://api.trigger.dev/\u200Binternal`
|
||||
- ❌ `https://api.trigger.dev/\u202Finternal`
|
||||
- ❌ `https://api.trigger.dev/\u2028internal`
|
||||
- ❌ `https://api.trigger.dev/\uFEFFinternal`
|
||||
|
||||
Validation errors use these exact messages:
|
||||
|
||||
@@ -189,6 +189,7 @@ Examples:
|
||||
- ❌ `https://api.trigger.dev/\rinternal` (internal carriage-return characters)
|
||||
- ❌ `https://api.trigger.dev/\u200Binternal` (internal zero-width-space characters)
|
||||
- ❌ `https://api.trigger.dev/\u202Finternal` (internal narrow no-break space characters)
|
||||
- ❌ `https://api.trigger.dev/\u2028internal` (internal line-separator characters)
|
||||
- ❌ `https://api.trigger.dev/\uFEFFinternal` (internal BOM characters)
|
||||
|
||||
Validation errors use these exact messages:
|
||||
|
||||
@@ -786,6 +786,17 @@ describe("TriggerChatTransport", function () {
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws when baseURL contains internal line-separator characters", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "https://api.trigger.dev/\u2028internal",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws when baseURL contains internal carriage-return characters", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
@@ -3481,6 +3492,17 @@ describe("TriggerChatTransport", function () {
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws from factory when baseURL contains internal line-separator characters", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "https://api.trigger.dev/\u2028internal",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws from factory when baseURL contains internal carriage-return characters", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
|
||||
Reference in New Issue
Block a user