@@ -492,7 +492,7 @@ describe('Oracle EPM guarded client', () => {
492492 it . each ( [ 'offset=-10&include=false' , 'offset=0&include=false' , 'offset=10&include=true' ] ) (
493493 'accepts canonical typed query %s without rewriting the returned URL' ,
494494 async ( query ) => {
495- const href = `${ prefix } ?${ query } &token=signed%2Bquery%2Fsecret`
495+ const href = `${ prefix } ?${ query } &token=signed%2Bquery%2Fsecret%5Cvalue `
496496 const handle = client . validateReturnedLink ( policy , { rel : 'next' , href } )
497497 expect ( JSON . stringify ( handle ) ) . toBe ( '{}' )
498498 await client . requestValidatedLink ( handle )
@@ -605,12 +605,16 @@ describe('Oracle EPM guarded client', () => {
605605 it . each (
606606 [
607607 'https://evil.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x' ,
608+ 'https://epm.example.com\\injected/gateway/SyntheticAlpha/rest/v3/files/abc?token=x' ,
609+ 'https://epm.example.com:443\\injected/gateway/SyntheticAlpha/rest/v3/files/abc?token=x' ,
610+ 'https://epm.example.com\\..\\injected/gateway/SyntheticAlpha/rest/v3/files/abc?token=x' ,
608611 'https://user@epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x' ,
609612 'https://epm.example.com/SyntheticAlpha/rest/v3/files/abc?token=x' ,
610613 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x&token=y' ,
611614 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?unknown=x' ,
612615 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x#fragment' ,
613616 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x#' ,
617+ 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/abc?token=x\\y' ,
614618 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/ab\nc?token=x' ,
615619 'https://epm.example.com/gateway/SyntheticAlpha/rest/v3/files/\uD800?token=x' ,
616620 'https://epm.example.com/gateway/SyntheticAlpha/rest//v3/files/abc?token=x' ,
@@ -639,7 +643,9 @@ describe('Oracle EPM guarded client', () => {
639643 instanceUrl : 'https://epm.example.com/gateway' ,
640644 accessToken : Buffer . from ( 'u:p' ) . toString ( 'base64' ) ,
641645 } )
642- expect ( ( ) => client . validateReturnedLink ( policy , { rel : relation , href } ) ) . toThrow ( )
646+ expect ( ( ) => client . validateReturnedLink ( policy , { rel : relation , href } ) ) . toThrowError (
647+ expect . objectContaining ( { name : 'OracleEpmError' , category : 'invalid_input' } )
648+ )
643649 expect ( mockValidateUrl ) . not . toHaveBeenCalled ( )
644650 expect ( mockSecureFetch ) . not . toHaveBeenCalled ( )
645651 } )
0 commit comments