@@ -1105,6 +1105,17 @@ describe("TriggerChatTransport", function () {
11051105 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
11061106 } ) ;
11071107
1108+ it ( "throws when newline-and-tab wrapped baseURL includes query parameters" , function ( ) {
1109+ expect ( function ( ) {
1110+ new TriggerChatTransport ( {
1111+ task : "chat-task" ,
1112+ accessToken : "pk_trigger" ,
1113+ baseURL : "\n\thttps://example.com/base/?query=1\t\n" ,
1114+ stream : "chat-stream" ,
1115+ } ) ;
1116+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
1117+ } ) ;
1118+
11081119 it ( "throws query/hash validation after trimming wrapper whitespace" , function ( ) {
11091120 expect ( function ( ) {
11101121 new TriggerChatTransport ( {
@@ -1138,6 +1149,17 @@ describe("TriggerChatTransport", function () {
11381149 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
11391150 } ) ;
11401151
1152+ it ( "throws when newline-and-tab wrapped baseURL includes hash fragments" , function ( ) {
1153+ expect ( function ( ) {
1154+ new TriggerChatTransport ( {
1155+ task : "chat-task" ,
1156+ accessToken : "pk_trigger" ,
1157+ baseURL : "\n\thttps://example.com/base/#fragment\t\n" ,
1158+ stream : "chat-stream" ,
1159+ } ) ;
1160+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
1161+ } ) ;
1162+
11411163 it ( "throws when baseURL includes username or password credentials" , function ( ) {
11421164 expect ( function ( ) {
11431165 new TriggerChatTransport ( {
@@ -1226,6 +1248,17 @@ describe("TriggerChatTransport", function () {
12261248 } ) . toThrowError ( "baseURL must not include username or password credentials" ) ;
12271249 } ) ;
12281250
1251+ it ( "throws when newline-and-tab wrapped baseURL includes username or password credentials" , function ( ) {
1252+ expect ( function ( ) {
1253+ new TriggerChatTransport ( {
1254+ task : "chat-task" ,
1255+ accessToken : "pk_trigger" ,
1256+ baseURL : "\n\thttps://user:pass@example.com/base/\t\n" ,
1257+ stream : "chat-stream" ,
1258+ } ) ;
1259+ } ) . toThrowError ( "baseURL must not include username or password credentials" ) ;
1260+ } ) ;
1261+
12291262 it ( "accepts https baseURL values without throwing" , function ( ) {
12301263 expect ( function ( ) {
12311264 new TriggerChatTransport ( {
@@ -4064,6 +4097,17 @@ describe("TriggerChatTransport", function () {
40644097 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
40654098 } ) ;
40664099
4100+ it ( "throws from factory when newline-and-tab wrapped baseURL includes query parameters" , function ( ) {
4101+ expect ( function ( ) {
4102+ createTriggerChatTransport ( {
4103+ task : "chat-task" ,
4104+ accessToken : "pk_trigger" ,
4105+ baseURL : "\n\thttps://example.com/base/?query=1\t\n" ,
4106+ stream : "chat-stream" ,
4107+ } ) ;
4108+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
4109+ } ) ;
4110+
40674111 it ( "throws query/hash validation after trimming wrapper whitespace in factory" , function ( ) {
40684112 expect ( function ( ) {
40694113 createTriggerChatTransport ( {
@@ -4097,6 +4141,17 @@ describe("TriggerChatTransport", function () {
40974141 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
40984142 } ) ;
40994143
4144+ it ( "throws from factory when newline-and-tab wrapped baseURL includes hash fragments" , function ( ) {
4145+ expect ( function ( ) {
4146+ createTriggerChatTransport ( {
4147+ task : "chat-task" ,
4148+ accessToken : "pk_trigger" ,
4149+ baseURL : "\n\thttps://example.com/base/#fragment\t\n" ,
4150+ stream : "chat-stream" ,
4151+ } ) ;
4152+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
4153+ } ) ;
4154+
41004155 it ( "throws from factory when baseURL includes username or password credentials" , function ( ) {
41014156 expect ( function ( ) {
41024157 createTriggerChatTransport ( {
@@ -4185,6 +4240,17 @@ describe("TriggerChatTransport", function () {
41854240 } ) . toThrowError ( "baseURL must not include username or password credentials" ) ;
41864241 } ) ;
41874242
4243+ it ( "throws from factory when newline-and-tab wrapped baseURL includes username or password credentials" , function ( ) {
4244+ expect ( function ( ) {
4245+ createTriggerChatTransport ( {
4246+ task : "chat-task" ,
4247+ accessToken : "pk_trigger" ,
4248+ baseURL : "\n\thttps://user:pass@example.com/base/\t\n" ,
4249+ stream : "chat-stream" ,
4250+ } ) ;
4251+ } ) . toThrowError ( "baseURL must not include username or password credentials" ) ;
4252+ } ) ;
4253+
41884254 it ( "accepts https baseURL values from factory without throwing" , function ( ) {
41894255 expect ( function ( ) {
41904256 createTriggerChatTransport ( {
0 commit comments