@@ -642,6 +642,17 @@ describe("TriggerChatTransport", function () {
642642 } ) . toThrowError ( "baseURL must be a valid absolute URL" ) ;
643643 } ) ;
644644
645+ it ( "throws when baseURL protocol is not http or https" , function ( ) {
646+ expect ( function ( ) {
647+ new TriggerChatTransport ( {
648+ task : "chat-task" ,
649+ accessToken : "pk_trigger" ,
650+ baseURL : "ftp://example.com" ,
651+ stream : "chat-stream" ,
652+ } ) ;
653+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
654+ } ) ;
655+
645656 it ( "combines path prefixes with run and stream URL encoding" , async function ( ) {
646657 let observedTriggerPath : string | undefined ;
647658 let observedStreamPath : string | undefined ;
@@ -2778,6 +2789,17 @@ describe("TriggerChatTransport", function () {
27782789 } ) . toThrowError ( "baseURL must be a valid absolute URL" ) ;
27792790 } ) ;
27802791
2792+ it ( "throws from factory when baseURL protocol is not http or https" , function ( ) {
2793+ expect ( function ( ) {
2794+ createTriggerChatTransport ( {
2795+ task : "chat-task" ,
2796+ accessToken : "pk_trigger" ,
2797+ baseURL : "ftp://example.com" ,
2798+ stream : "chat-stream" ,
2799+ } ) ;
2800+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
2801+ } ) ;
2802+
27812803 it ( "continues streaming when onTriggeredRun callback throws" , async function ( ) {
27822804 let callbackCalled = false ;
27832805 const errors : TriggerChatTransportError [ ] = [ ] ;
0 commit comments