Compare commits
4 Commits
7bc1e8d928
...
main
| Author | SHA256 | Date | |
|---|---|---|---|
| 38ed485bd8 | |||
| a64cb5b4de | |||
|
|
490c1cc724 | ||
|
|
ef9f6ba9c7 |
4
index.js
4
index.js
@@ -53,7 +53,7 @@ function verifyToken(token) {
|
||||
return split[0];
|
||||
}
|
||||
function sanitiseStringHTML(str) {
|
||||
return str.replaceAll(">", ">").replaceAll("<", "<");
|
||||
return str.replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<");
|
||||
}
|
||||
|
||||
app.use(express.urlencoded());
|
||||
@@ -75,6 +75,8 @@ app.use((req, res, next) => {
|
||||
});
|
||||
app.use((req, res, next) => {
|
||||
req.userId = verifyToken(req.cookies.token);
|
||||
if (!req.headers['x-forwarded-for']) return next();
|
||||
|
||||
const geo = geoip.lookup(req.headers['x-forwarded-for']);
|
||||
console.log(geo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user