Skip to content

Commit 460fd87

Browse files
committed
dep bump & associated fixes
ended up needing to bump the minimum version of node.js from 6 to 8 and update a few of the tests also, lots of formatting changes + one eslint-disable because it kept breaking the code
1 parent 4f05030 commit 460fd87

40 files changed

+9012
-8908
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules/
66
.nyc_output/
77
.vscode/
88
examples/*/package-lock.json
9+
.tap

examples/blacklist/blacklist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function ({ blockedDomains, message }) {
77
const { hostname } = URL.parse(data.url);
88
return blockedDomains.some(
99
(blockedDomain) =>
10-
hostname === blockedDomain || hostname.endsWith(`.${blockedDomain}`)
10+
hostname === blockedDomain || hostname.endsWith(`.${blockedDomain}`),
1111
);
1212
}
1313

examples/blacklist/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const unblocker = Unblocker({
1919
app.use(unblocker);
2020

2121
app.get("/", (req, res) =>
22-
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page")
22+
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"),
2323
);
2424

2525
app.listen(8080).on("upgrade", unblocker.onUpgrade);

examples/custom-user-agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"unblocker": "file:..\\.."
88
},
99
"engines": {
10-
"node": ">=6"
10+
"node": ">=8"
1111
},
1212
"scripts": {
1313
"start": "node server.js"

examples/custom-user-agent/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ app.use(unblocker);
1515

1616
app.get("/", (req, res) =>
1717
res.end(
18-
"Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy."
19-
)
18+
"Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy.",
19+
),
2020
);
2121

2222
app.listen(8080).on("upgrade", unblocker.onUpgrade);
2323

2424
console.log(
25-
"app listening on port 8080. Test at http://localhost:8080/proxy/https://duckduckgo.com/?q=what%27s+my+user+agent&atb=v130-1ei&ia=answer"
25+
"app listening on port 8080. Test at http://localhost:8080/proxy/https://duckduckgo.com/?q=what%27s+my+user+agent&atb=v130-1ei&ia=answer",
2626
);

examples/express/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const unblocker = Unblocker({
1010
app.use(unblocker);
1111

1212
app.get("/", (req, res) =>
13-
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page")
13+
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"),
1414
);
1515

1616
// start the server and allow unblocker to proxy websockets:

examples/replace_snippet/replace_snippet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function (config) {
1818
this.push(updated, "utf8");
1919
next();
2020
},
21-
})
21+
}),
2222
);
2323
}
2424
}

examples/replace_snippet/server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ app.use(
1212
responseMiddleware: [
1313
replaceSnippet({
1414
processContentTypes: ["text/html"],
15-
searchFor: /<script type="text\/javascript">\s*BrowserCheck.testForCookies\(\);\s*<\/script>/i,
15+
searchFor:
16+
/<script type="text\/javascript">\s*BrowserCheck.testForCookies\(\);\s*<\/script>/i,
1617
replaceWith: "",
1718
}),
1819
],
19-
})
20+
}),
2021
);
2122

2223
app.get("/", (req, res) =>
23-
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page")
24+
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"),
2425
);
2526

2627
app.listen(8080);

examples/simple/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var server = http
1818
if (req.url == "/") {
1919
res.writeHead(200, headers);
2020
return res.end(
21-
"Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy."
21+
"Use the format http://thissite.com/proxy/http://site-i-want.com/ to access the proxy.",
2222
);
2323
} else {
2424
res.writeHead(404, headers);

examples/whitelist/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const unblocker = Unblocker({
1818
app.use(unblocker);
1919

2020
app.get("/", (req, res) =>
21-
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page")
21+
res.redirect("/proxy/https://en.wikipedia.org/wiki/Main_Page"),
2222
);
2323

2424
app.listen(8080).on("upgrade", unblocker.onUpgrade);

0 commit comments

Comments
 (0)