Combine parse + blacklist middleware
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
const blacklist = require('../PackageBlacklist').blacklist
|
||||
|
||||
/**
|
||||
* Check the blacklist to see if we can serve files from this package.
|
||||
*/
|
||||
function checkBlacklist(req, res, next) {
|
||||
if (blacklist.includes(req.packageName)) {
|
||||
res.status(403).type('text').send(`Package ${req.packageName} is blacklisted`)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = checkBlacklist
|
Reference in New Issue
Block a user