make user-agent check case insenstive (#161)

Looks & works fine, thanks @andymckay !
This commit is contained in:
Andy McKay
2016-12-12 14:32:39 -08:00
committed by wbamberg
parent dd22610f92
commit 62cd6d0a12
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
/*
This is the page for which we want to rewrite the User-Agent header.
*/
var targetPage = "http://useragentstring.com/*";
var targetPage = "https://httpbin.org/*";
/*
Map browser names to UA strings.
@@ -24,7 +24,7 @@ Rewrite the User-Agent header to "ua".
*/
function rewriteUserAgentHeader(e) {
for (var header of e.requestHeaders) {
if (header.name == "User-Agent") {
if (header.name.toLowerCase() === "user-agent") {
header.value = ua;
}
}