Skip to content
Browse files

Throw 404 in case of an unpublished module - fix #271

  • Loading branch information...
1 parent 7f727fa commit 70a7d494f63227485229949d2d99e340335a051b @robertkowalski committed Mar 18, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 routes/package-page.js
View
4 routes/package-page.js
@@ -25,6 +25,10 @@ function packagePage (req, res) {
if (er && er.code === 'E404') return res.error(404, er)
if (er) return res.error(er)
if (!m.package) return res.error(404)
+ // We are catching this one very late in the application
+ // as the npm-client will have cached this response as json
+ // and we are not getting a valid http error code in that case
+ if (m.package.error === 'not_found') return res.error(404)
var p = m.package
p.dependents = m.browse

0 comments on commit 70a7d49

Please sign in to comment.
Something went wrong with that request. Please try again.