Update index.js
This commit is contained in:
parent
32d0dee7ea
commit
2cd72fa71b
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -24,7 +24,7 @@ const RL = rateLimit({
|
|||
max: app.config.rateLimiting ? 100 : 0, // max requests per 5 minutes
|
||||
message: rlMessage,
|
||||
keyGenerator: function(req) { return req.headers['x-real-ip'] || req.headers['x-forwarded-for'] },
|
||||
skip: function(req) { return ((req.url.includes("api/level") && !req.query.hasOwnProperty("download")) ? true : false) }
|
||||
skip: function(req) { return (req.url.includes("api/level") && !req.query.hasOwnProperty("download")) }
|
||||
})
|
||||
|
||||
const RL2 = rateLimit({
|
||||
|
@ -173,7 +173,7 @@ app.parseResponse = function (responseBody, splitter=":") {
|
|||
}
|
||||
|
||||
//xss bad
|
||||
app.clean = function(text) {if (!text || typeof text != "string") return text; else return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/=/g, "=").replace(/"/g, """).replace(/'/g, "'")}
|
||||
app.clean = function(text) {return !text || typeof text != "string" ? text : text.replace(/./gs, c => {"&": "&", "<": "<", ">": ">", "=": "=", '"': """, "'": "'"}[c] || c)}
|
||||
|
||||
// ASSETS
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue