Skip to content

Commit

Permalink
Make blacklist message more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
pastelsky committed Sep 29, 2019
1 parent 97eec38 commit 2c34d45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion server/middlewares/results/blockBlacklist.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const CustomError = require('./../../CustomError')
const CONFIG = require('../../config')

async function blockBlacklistMiddleware(ctx, next) {
const { package: packageString } = ctx.query
const { package: packageString, force } = ctx.query
if(force) { await next(); return }

const parsedPackage = parsePackageString(packageString)

// If package is blacklisted, fail fast
Expand Down
6 changes: 3 additions & 3 deletions server/middlewares/results/error.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ async function errorHandler(ctx, next) {
case 'BlacklistedPackageError':
respondWithError(403, {
code: 'BlacklistedPackageError',
message: 'The package you were looking for is blacklisted due to suspicious activity in the past, ' +
'or because it\'s failed to build multiple times, ' +
'and isn\'t bundle size calculations might not apply here.',
message: 'The package you were looking for is blacklisted ' +
'because it failed to build multiple times in the past and further tries aren\'t likely to succeed. This can' +
'happen if the package in question wasn\'t meant to be bundled in a client side application.',
})
break

Expand Down

0 comments on commit 2c34d45

Please sign in to comment.