@@ -1061,6 +1061,17 @@ describe("TriggerChatTransport", function () {
10611061 } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
10621062 } ) ;
10631063
1064+ it ( "throws when newline-and-tab wrapped baseURL protocol is ws" , function ( ) {
1065+ expect ( function ( ) {
1066+ new TriggerChatTransport ( {
1067+ task : "chat-task" ,
1068+ accessToken : "pk_trigger" ,
1069+ baseURL : "\n\tws://example.com\t\n" ,
1070+ stream : "chat-stream" ,
1071+ } ) ;
1072+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
1073+ } ) ;
1074+
10641075 it ( "throws when baseURL protocol is wss" , function ( ) {
10651076 expect ( function ( ) {
10661077 new TriggerChatTransport ( {
@@ -1083,6 +1094,17 @@ describe("TriggerChatTransport", function () {
10831094 } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
10841095 } ) ;
10851096
1097+ it ( "throws when newline-and-tab wrapped baseURL protocol is wss" , function ( ) {
1098+ expect ( function ( ) {
1099+ new TriggerChatTransport ( {
1100+ task : "chat-task" ,
1101+ accessToken : "pk_trigger" ,
1102+ baseURL : "\n\twss://example.com\t\n" ,
1103+ stream : "chat-stream" ,
1104+ } ) ;
1105+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
1106+ } ) ;
1107+
10861108 it ( "throws when baseURL includes query parameters" , function ( ) {
10871109 expect ( function ( ) {
10881110 new TriggerChatTransport ( {
@@ -4053,6 +4075,17 @@ describe("TriggerChatTransport", function () {
40534075 } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
40544076 } ) ;
40554077
4078+ it ( "throws from factory when newline-and-tab wrapped baseURL protocol is ws" , function ( ) {
4079+ expect ( function ( ) {
4080+ createTriggerChatTransport ( {
4081+ task : "chat-task" ,
4082+ accessToken : "pk_trigger" ,
4083+ baseURL : "\n\tws://example.com\t\n" ,
4084+ stream : "chat-stream" ,
4085+ } ) ;
4086+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
4087+ } ) ;
4088+
40564089 it ( "throws from factory when baseURL protocol is wss" , function ( ) {
40574090 expect ( function ( ) {
40584091 createTriggerChatTransport ( {
@@ -4075,6 +4108,17 @@ describe("TriggerChatTransport", function () {
40754108 } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
40764109 } ) ;
40774110
4111+ it ( "throws from factory when newline-and-tab wrapped baseURL protocol is wss" , function ( ) {
4112+ expect ( function ( ) {
4113+ createTriggerChatTransport ( {
4114+ task : "chat-task" ,
4115+ accessToken : "pk_trigger" ,
4116+ baseURL : "\n\twss://example.com\t\n" ,
4117+ stream : "chat-stream" ,
4118+ } ) ;
4119+ } ) . toThrowError ( "baseURL must use http or https protocol" ) ;
4120+ } ) ;
4121+
40784122 it ( "throws from factory when baseURL includes query parameters" , function ( ) {
40794123 expect ( function ( ) {
40804124 createTriggerChatTransport ( {
0 commit comments