More IP tweaks

This commit is contained in:
GDColon 2020-04-09 10:42:08 -04:00
parent 584320e3c8
commit 27730bfcea
2 changed files with 2 additions and 4 deletions

View file

@ -47,7 +47,7 @@ module.exports = async (app, req, res) => {
request.post(app.endpoint + 'uploadGJComment21.php', { request.post(app.endpoint + 'uploadGJComment21.php', {
form: params, form: params,
headers: {'x-forwarded-for': req.headers['x-forwarded-for'] || req.connection.remoteAddress} // prevent pesky ip bans headers: {'x-forwarded-for': req.headers['x-real-ip']} // prevent pesky ip bans
}, function (err, resp, body) { }, function (err, resp, body) {
if (err) return res.status(400).send("The Geometry Dash servers returned an error! Perhaps they're down for maintenance") if (err) return res.status(400).send("The Geometry Dash servers returned an error! Perhaps they're down for maintenance")
if (!body || body == "-1") return res.status(400).send("The Geometry Dash servers rejected your comment! Try again later, or make sure your username and password are entered correctly.") if (!body || body == "-1") return res.status(400).send("The Geometry Dash servers rejected your comment! Try again later, or make sure your username and password are entered correctly.")

View file

@ -54,8 +54,6 @@ app.parseResponse = function (responseBody, splitter) {
//xss bad //xss bad
app.clean = function(text) {if (!text || typeof text != "string") return text; else return text.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;").replace(/=/g, "&#61;").replace(/"/g, "&#34;").replace(/'/g, "&#39;")} app.clean = function(text) {if (!text || typeof text != "string") return text; else return text.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;").replace(/=/g, "&#61;").replace(/"/g, "&#34;").replace(/'/g, "&#39;")}
console.log("Site online!")
// ASSETS // ASSETS
@ -142,4 +140,4 @@ app.get('*', function(req, res) {
else res.redirect('/search/404%20') else res.redirect('/search/404%20')
}); });
app.listen(2000); app.listen(2000, () => console.log("Site online!"))