Skip to content

Commit

Permalink
Workaround broken tarball urls from old npms
Browse files Browse the repository at this point in the history
This was affecting mongodb.  Just always force the tarball
to be an attachment on the doc, and only trust the filename.
  • Loading branch information
isaacs committed Aug 12, 2012
1 parent d4e59f5 commit b9a6abc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion registry/shows.js
Expand Up @@ -66,7 +66,7 @@ shows.package = function (doc, req) {
// .../_rewrite/pkg/-/pkg-version.tgz
// or: /pkg/-/pkg-version.tgz
// depending on what requested path is.
var tf = t.split('/').slice(-3)
var tf = [doc.name, '-', t.split('/').pop()]
var i = requestedPath.indexOf('_rewrite')
if (i !== -1) {
tf = requestedPath.slice(0, i + 1).concat(tf)
Expand Down

0 comments on commit b9a6abc

Please sign in to comment.