aboutsummaryrefslogtreecommitdiffstats
path: root/lib/HttpRequestHeaders.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/HttpRequestHeaders.jsm')
-rw-r--r--lib/HttpRequestHeaders.jsm28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/HttpRequestHeaders.jsm b/lib/HttpRequestHeaders.jsm
index 4c125eb..9662022 100644
--- a/lib/HttpRequestHeaders.jsm
+++ b/lib/HttpRequestHeaders.jsm
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}.
- Home: https://gitlab.com/vannilla/ematrix
+ Home: https://libregit.org/heckyel/ematrix
uMatrix Home: https://github.com/gorhill/uMatrix
*/
@@ -34,7 +34,7 @@ var HTTPRequestHeaders = function (channel) {
HTTPRequestHeaders.factory = function (channel) {
let entry = junkyard.pop();
if (entry) {
- return entry.init(channel);
+ return entry.init(channel);
}
return new HTTPRequestHeaders(channel);
@@ -44,14 +44,14 @@ HTTPRequestHeaders.prototype.init = function (channel) {
this.channel = channel;
this.headers = new Array();
this.originalHeaderNames = new Array();
-
+
channel.visitRequestHeaders({
- visitHeader: function (name, value) {
- this.headers.push({name: name, value: value});
- this.originalHeaderNames.push(name);
- }.bind(this)
+ visitHeader: function (name, value) {
+ this.headers.push({name: name, value: value});
+ this.originalHeaderNames.push(name);
+ }.bind(this)
});
-
+
return this;
};
@@ -68,11 +68,11 @@ HTTPRequestHeaders.prototype.update = function () {
this.setHeader(header.name, header.value, true);
newHeaderNames.add(header.name);
}
-
+
//Clear any headers that were removed
for (let name of this.originalHeaderNames) {
if (!newHeaderNames.has(name)) {
- this.channel.setRequestHeader(name, '', false);
+ this.channel.setRequestHeader(name, '', false);
}
}
};
@@ -81,9 +81,9 @@ HTTPRequestHeaders.prototype.getHeader = function (name) {
try {
return this.channel.getRequestHeader(name);
} catch (e) {
- // Ignore
+ // Ignore
}
-
+
return '';
};
@@ -92,11 +92,11 @@ HTTPRequestHeaders.prototype.setHeader = function (name, newValue, create) {
if (newValue === oldValue) {
return false;
}
-
+
if (oldValue === '' && create !== true) {
return false;
}
-
+
this.channel.setRequestHeader(name, newValue, false);
return true;
};