aboutsummaryrefslogtreecommitdiffstats
path: root/lib/HttpRequestHeaders.jsm
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-12-30 16:10:54 -0500
committerJesús <heckyel@hyperbola.info>2019-12-30 16:10:54 -0500
commitd1d3aaa224ec068dc8d267e4d64255f88b6641a0 (patch)
tree9e6b679c529dca7217becc7856ea6aac2d3069f7 /lib/HttpRequestHeaders.jsm
parentfa6fb12f089ff0170d0f3ee93b6ce7131a6a2254 (diff)
downloadematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.tar.lz
ematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.tar.xz
ematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.zip
fix syntax libraries
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;
};