mirror of
https://github.com/trufflesecurity/xsshunter
synced 2024-12-18 08:33:16 +00:00
allow case sensitive routing (#43)
This commit is contained in:
parent
b4053b93d0
commit
1e0ee57543
1 changed files with 1 additions and 16 deletions
15
app.js
15
app.js
|
@ -86,21 +86,6 @@ async function get_app_server() {
|
||||||
// https://youtu.be/ZtjFsQBuJWw?t=4
|
// https://youtu.be/ZtjFsQBuJWw?t=4
|
||||||
app.set('case sensitive routing', true);
|
app.set('case sensitive routing', true);
|
||||||
|
|
||||||
// Making 100% sure this works like it should
|
|
||||||
// https://youtu.be/aCbfMkh940Q?t=6
|
|
||||||
app.use(async function(req, res, next) {
|
|
||||||
if(req.path.toLowerCase() === req.path) {
|
|
||||||
next();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res.status(401).json({
|
|
||||||
"success": false,
|
|
||||||
"error": "No.",
|
|
||||||
"code": "WHY_ARE_YOU_SHOUTING"
|
|
||||||
}).end();
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
|
|
||||||
// Set security-related headers on requests
|
// Set security-related headers on requests
|
||||||
|
|
Loading…
Reference in a new issue