File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -774,6 +774,17 @@ describe("TriggerChatTransport", function () {
774774 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
775775 } ) ;
776776
777+ it ( "prioritizes hash validation over credential validation" , function ( ) {
778+ expect ( function ( ) {
779+ new TriggerChatTransport ( {
780+ task : "chat-task" ,
781+ accessToken : "pk_trigger" ,
782+ baseURL : "https://user:pass@example.com/base#fragment" ,
783+ stream : "chat-stream" ,
784+ } ) ;
785+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
786+ } ) ;
787+
777788 it ( "throws when trimmed baseURL includes username or password credentials" , function ( ) {
778789 expect ( function ( ) {
779790 new TriggerChatTransport ( {
@@ -3145,6 +3156,17 @@ describe("TriggerChatTransport", function () {
31453156 } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
31463157 } ) ;
31473158
3159+ it ( "prioritizes hash validation over credential validation in factory" , function ( ) {
3160+ expect ( function ( ) {
3161+ createTriggerChatTransport ( {
3162+ task : "chat-task" ,
3163+ accessToken : "pk_trigger" ,
3164+ baseURL : "https://user:pass@example.com/base#fragment" ,
3165+ stream : "chat-stream" ,
3166+ } ) ;
3167+ } ) . toThrowError ( "baseURL must not include query parameters or hash fragments" ) ;
3168+ } ) ;
3169+
31483170 it ( "throws from factory when trimmed baseURL includes username or password credentials" , function ( ) {
31493171 expect ( function ( ) {
31503172 createTriggerChatTransport ( {
You can’t perform that action at this time.
0 commit comments