diff --git a/front/src/js/services/apiService.js b/front/src/js/services/apiService.js index c0234bc..0482748 100644 --- a/front/src/js/services/apiService.js +++ b/front/src/js/services/apiService.js @@ -14,7 +14,7 @@ apiService.factory('API', ['$location', 'Runs', 'Results', function($location, R waitForSelector: settings.waitForSelector, cookie: settings.cookie, authUser: settings.authUser, - authPass: settings.authPass, + authPass: settings.authPass }; if (settings.waitForSelector && settings.waitForSelector !== '') { diff --git a/lib/tools/weightChecker/weightChecker.js b/lib/tools/weightChecker/weightChecker.js index 31560a0..ea2f472 100644 --- a/lib/tools/weightChecker/weightChecker.js +++ b/lib/tools/weightChecker/weightChecker.js @@ -24,7 +24,7 @@ var WeightChecker = function() { // This function will re-download every asset and check if it could be optimized - function recheckAllFiles(data, httpAuth) { + function recheckAllFiles(data) { var startTime = Date.now(); debug('Redownload started'); var deferred = Q.defer(); @@ -34,7 +34,7 @@ var WeightChecker = function() { delete data.toolsResults.phantomas.offenders.requestsList; var httpAuth = null; - if (data.params.options.authUser && data.params.options.authPass) { + if (data.params && data.params.options && data.params.options.authUser && data.params.options.authPass) { httpAuth = { username: data.params.options.authUser, password: data.params.options.authPass @@ -381,7 +381,7 @@ var WeightChecker = function() { user: httpAuth.username, pass: httpAuth.password, sendImmediately: false // Tries a first time without auth, wait for a 401 error before resending - } + }; } download(requestOptions, entry.contentType, function(error, result) { diff --git a/package.json b/package.json index 1b13e19..6d4d1e9 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "lwip": "0.0.7", "meow": "3.3.0", "minimize": "1.7.0", - "phantomas": "1.11.0", + "phantomas": "1.12.0", "ps-node": "0.0.4", "q": "1.4.1", "request": "2.61.0",