From c3f9f6b7160a372055dd9f55593cd1d5d76d000a Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 18 Feb 2018 06:08:48 -0500 Subject: [PATCH] code review: bit stricter code path --- src/js/redirect-engine.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index 967d700fc..b2ccda7da 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -88,13 +88,12 @@ var RedirectEntry = function() { // - https://bugzilla.mozilla.org/show_bug.cgi?id=998076 RedirectEntry.prototype.toURL = function(details) { - if ( this.warURL !== undefined ) { - if ( - details instanceof Object === false || - details.requestType !== 'xmlhttprequest' - ) { - return this.warURL + '?secret=' + vAPI.warSecret; - } + if ( + this.warURL !== undefined && + details instanceof Object && + details.requestType !== 'xmlhttprequest' + ) { + return this.warURL + '?secret=' + vAPI.warSecret; } if ( this.data.startsWith('data:') === false ) { if ( this.mime.indexOf(';') === -1 ) {