File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -670,6 +670,7 @@ Examples:
670670- ✅ ` https://api.trigger.dev/custom%3Fprefix%23segment ` (percent-encoded ` ? ` / ` # ` )
671671- ✅ ` \uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF ` (BOM wrapper trimmed)
672672- ❌ ` \u2060https://api.trigger.dev/custom-prefix/\u2060 ` (word-joiner wrappers are rejected)
673+ - ❌ ` \u200Bhttps://api.trigger.dev/custom-prefix/\u200B ` (zero-width-space wrappers are rejected)
673674- ❌ ` https://api.trigger.dev?foo=bar `
674675- ❌ ` https://api.trigger.dev#fragment `
675676- ❌ ` https://user:pass@api.trigger.dev `
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ Examples:
177177- ✅ ` https://api.trigger.dev/custom%3Fprefix%23segment ` (percent-encoded ` ? ` / ` # ` )
178178- ✅ ` \uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF ` (BOM wrapper trimmed)
179179- ❌ ` \u2060https://api.trigger.dev/custom-prefix/\u2060 ` (word-joiner wrappers are rejected)
180+ - ❌ ` \u200Bhttps://api.trigger.dev/custom-prefix/\u200B ` (zero-width-space wrappers are rejected)
180181- ❌ ` https://api.trigger.dev?foo=bar ` (query string)
181182- ❌ ` https://api.trigger.dev#fragment ` (hash fragment)
182183- ❌ ` https://user:pass@api.trigger.dev ` (credentials)
Original file line number Diff line number Diff line change @@ -841,6 +841,17 @@ describe("TriggerChatTransport", function () {
841841 } ) . toThrowError ( "baseURL must not contain internal whitespace characters" ) ;
842842 } ) ;
843843
844+ it ( "throws when baseURL is wrapped with zero-width-space characters" , function ( ) {
845+ expect ( function ( ) {
846+ new TriggerChatTransport ( {
847+ task : "chat-task" ,
848+ accessToken : "pk_trigger" ,
849+ baseURL : "\u200Bhttps://api.trigger.dev/custom-prefix/\u200B" ,
850+ stream : "chat-stream" ,
851+ } ) ;
852+ } ) . toThrowError ( "baseURL must not contain internal whitespace characters" ) ;
853+ } ) ;
854+
844855 it ( "throws when baseURL contains internal zero-width-non-joiner characters" , function ( ) {
845856 expect ( function ( ) {
846857 new TriggerChatTransport ( {
@@ -3624,6 +3635,17 @@ describe("TriggerChatTransport", function () {
36243635 } ) . toThrowError ( "baseURL must not contain internal whitespace characters" ) ;
36253636 } ) ;
36263637
3638+ it ( "throws from factory when baseURL is wrapped with zero-width-space characters" , function ( ) {
3639+ expect ( function ( ) {
3640+ createTriggerChatTransport ( {
3641+ task : "chat-task" ,
3642+ accessToken : "pk_trigger" ,
3643+ baseURL : "\u200Bhttps://api.trigger.dev/custom-prefix/\u200B" ,
3644+ stream : "chat-stream" ,
3645+ } ) ;
3646+ } ) . toThrowError ( "baseURL must not contain internal whitespace characters" ) ;
3647+ } ) ;
3648+
36273649 it ( "throws from factory when baseURL contains internal zero-width-non-joiner characters" , function ( ) {
36283650 expect ( function ( ) {
36293651 createTriggerChatTransport ( {
You can’t perform that action at this time.
0 commit comments