diff options
author | Einar Egilsson <einar@einaregilsson.com> | 2018-08-17 10:41:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 10:41:58 +0000 |
commit | 506f78a13124fdbe5e33485dbd0b079cd8fffd47 (patch) | |
tree | 0e269965cc77f6b78c4b8821c910518c259ab414 /js/redirect.js | |
parent | 005cdf5953a165c5f117102382cd38ecb641fa2f (diff) | |
parent | 12c3df39097905f981a392dceaa93ac879813159 (diff) |
Merge pull request #120 from gkrishnaks/master
Typo correction in variable declaration, and closes feature requests #104, #86, #72 and fix for issue #115, updated excludeMatch() for faster regex check.
Diffstat (limited to 'js/redirect.js')
-rw-r--r-- | js/redirect.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/redirect.js b/js/redirect.js index 83681fc..ac06ff7 100644 --- a/js/redirect.js +++ b/js/redirect.js @@ -18,6 +18,7 @@ Redirect.requestTypes = { stylesheet : "Stylesheets", script : "Scripts", image : "Images", + imageset: "Responsive Images in Firefox", object : "Objects (e.g. Flash videos, Java applets)", xmlhttprequest : "XMLHttpRequests (Ajax)", other : "Other" @@ -33,6 +34,7 @@ Redirect.prototype = { error : null, includePattern : '', excludePattern : '', + patternDesc:'', redirectUrl : '', patternType : '', processMatches : 'noProcessing', @@ -56,6 +58,7 @@ Redirect.prototype = { && this.exampleUrl == redirect.exampleUrl && this.includePattern == redirect.includePattern && this.excludePattern == redirect.excludePattern + && this.patternDesc == redirect.patternDesc && this.redirectUrl == redirect.redirectUrl && this.patternType == redirect.patternType && this.processMatches == redirect.processMatches @@ -70,6 +73,7 @@ Redirect.prototype = { error : this.error, includePattern : this.includePattern, excludePattern : this.excludePattern, + patternDesc : this.patternDesc, redirectUrl : this.redirectUrl, patternType : this.patternType, processMatches : this.processMatches, @@ -208,6 +212,7 @@ Redirect.prototype = { this.excludePattern = o.excludePattern || ''; this.redirectUrl = o.redirectUrl || ''; this.patternType = o.patternType || Redirect.WILDCARD; + this.patternDesc = o.patternDesc || ''; this.processMatches = o.processMatches || 'noProcessing'; if (!o.processMatches && o.unescapeMatches) { this.processMatches = 'urlDecode'; @@ -261,7 +266,7 @@ Redirect.prototype = { if (!this._rxExclude) { return false; } - var shouldExclude = !!this._rxExclude.exec(url); + var shouldExclude = this._rxExclude.test(url); this._rxExclude.lastIndex = 0; return shouldExclude; } |