Cover internal tab characters in baseURL validation
Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
@@ -731,6 +731,17 @@ describe("TriggerChatTransport", function () {
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws when baseURL contains internal tab characters", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "https://api.trigger.dev/\tinternal",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws when baseURL is a relative path", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
@@ -3283,6 +3294,17 @@ describe("TriggerChatTransport", function () {
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws from factory when baseURL contains internal tab characters", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "https://api.trigger.dev/\tinternal",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).toThrowError("baseURL must not contain internal whitespace characters");
|
||||
});
|
||||
|
||||
it("throws from factory when baseURL protocol is not http or https", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
|
||||
Reference in New Issue
Block a user