Remove blacklist code

This commit is contained in:
Michael Jackson
2019-01-15 08:06:12 -08:00
parent 5e7323f389
commit dc2950d60f
14 changed files with 3 additions and 493 deletions

View File

@ -1,23 +0,0 @@
import { includesPackage } from '../utils/blacklist';
export default function checkBlacklist(req, res, next) {
includesPackage(req.packageName).then(
blacklisted => {
// Disallow packages that have been blacklisted.
if (blacklisted) {
res
.status(403)
.type('text')
.send(`Package "${req.packageName}" is blacklisted`);
} else {
next();
}
},
error => {
console.error('Unable to fetch the blacklist: %s', error);
// Continue anyway.
next();
}
);
}