@@ -11,8 +11,9 @@ const https = require("https");
1111describe ( "Tests for most recent .tgz package" , function ( ) {
1212 const baseDir = path . join ( __dirname , "../.." ) ;
1313 const extractPath = path . join ( baseDir , "temp-lib" ) ;
14- let URIValidate ;
14+ let URIValidator ;
1515 let AntiSSRFPolicy ;
16+ let PolicyConfigOptions ;
1617
1718 before ( async function ( ) {
1819 // Find the .tgz file dynamically
@@ -37,13 +38,14 @@ describe("Tests for most recent .tgz package", function () {
3738 } ) ; // Dynamically require the AddOne function
3839
3940 const lib = require ( path . join ( extractPath , "out/src/index.js" ) ) ; // Adjust if needed
40- URIValidate = lib . URIValidate ;
41+ URIValidator = lib . URIValidator ;
4142 AntiSSRFPolicy = lib . AntiSSRFPolicy ;
43+ PolicyConfigOptions = lib . PolicyConfigOptions ;
4244 } ) ;
4345
44- it ( "URIValidate .inDomain test" , ( ) => {
45- assert . equal ( URIValidate . inDomain ( "https://example.com" , ".example.com" ) , true ) ;
46- assert . equal ( URIValidate . inDomain ( "https://example.com.evil.com" , "example.com" ) , false ) ;
46+ it ( "URIValidator .inDomain test" , ( ) => {
47+ assert . equal ( URIValidator . inDomain ( "https://example.com" , ".example.com" ) , true ) ;
48+ assert . equal ( URIValidator . inDomain ( "https://example.com.evil.com" , "example.com" ) , false ) ;
4749 } ) ;
4850
4951 describe ( "AntiSSRFPolicy tests" , ( ) => {
@@ -54,11 +56,11 @@ describe("Tests for most recent .tgz package", function () {
5456 policy . addRequiredHeaders ( [ "test-required-header" ] ) ;
5557 policy . addDeniedHeaders ( [ "test-denied-header" ] ) ;
5658
57- googleIPs = await dns . promises . lookup ( "www.google.com" , {
59+ const googleIPs = await dns . promises . lookup ( "www.google.com" , {
5860 family : 0 ,
5961 all : true
6062 } ) ;
61- appleIPs = await dns . promises . lookup ( "apple.com" , { family : 0 , all : true } ) ;
63+ const appleIPs = await dns . promises . lookup ( "apple.com" , { family : 0 , all : true } ) ;
6264 policy . addDeniedAddresses ( [ ...googleIPs , ...appleIPs ] . map ( ( address ) => address . address ) ) ;
6365
6466 antiSSRFHttpsAgent = policy . getHttpsAgent ( ) ;
0 commit comments