mirror of https://github.com/calzoneman/sync.git
Fix error on empty user-agent
This commit is contained in:
parent
15dc61a761
commit
0f9c3b2dd1
|
@ -258,10 +258,10 @@ module.exports = {
|
|||
require("./acp").init(app);
|
||||
app.all("*", function (req, res, next) {
|
||||
if (isSuspicious(req)) {
|
||||
console.log("isSuspicious");
|
||||
logRequest(req, 403);
|
||||
res.status(403);
|
||||
if (req.header("user-agent").toLowerCase() === "zmeu") {
|
||||
if (typeof req.header("user-agent") === "string" &&
|
||||
req.header("user-agent").toLowerCase() === "zmeu") {
|
||||
res.send("This server disallows requests from ZmEu.");
|
||||
} else {
|
||||
res.send("The request " + req.route.method.toUpperCase() + " " +
|
||||
|
|
Loading…
Reference in New Issue