changed the url to /feed/ and reject everything else
This commit is contained in:
parent
708034e143
commit
22cee0b4fa
@ -24,6 +24,10 @@ const cache = apicache.middleware;
|
||||
|
||||
app.use(cache('15 minutes'));
|
||||
|
||||
const ips = [
|
||||
|
||||
];
|
||||
|
||||
const bouncer = ['phpmyadmin',
|
||||
'phpMyadmin',
|
||||
'phpMyAdmin',
|
||||
@ -84,6 +88,7 @@ const bouncer = ['phpmyadmin',
|
||||
|
||||
function getUrl (req, res) {
|
||||
const theUrl = req.params.encoded_id;
|
||||
logger.info(`IP:${req.ip}`);
|
||||
logger.debug('Want', theUrl);
|
||||
if (theUrl === undefined || bouncer.indexOf(theUrl) !== -1 || theUrl === '') {
|
||||
logger.warn(`You're not getting in ${theUrl}`);
|
||||
@ -180,7 +185,9 @@ app.get('/feed/:encoded_id', getUrl);
|
||||
|
||||
// Final middleware is our catch-all error handler
|
||||
app.get('*', function(req, res, next) {
|
||||
const err = new Error(`${req.ip} tried to access /Forbidden`); // Sets error message, includes the requester's ip address!
|
||||
log
|
||||
const err = new Error(`${req.ip} tried to access /Forbidden`);
|
||||
// Sets error message, includes the requester's ip address!
|
||||
err.statusCode = 403;
|
||||
next(err);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user