Permalink
Browse files

Only add the slash if necessary

  • Loading branch information...
1 parent c8414d6 commit fb407a7ef41ed61fa86b62e2d4da181cd96b1972 @isaacs isaacs committed Jul 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 registry/app.js
View
@@ -877,11 +877,11 @@ ddoc.shows.package = function (doc, req) {
var basePath = req.requested_path
if (basePath.indexOf("_show") === -1) basePath = ""
else {
- basePath = basePath.slice(0, basePath.indexOf("_show"))
+ basePath = "/" + basePath.slice(0, basePath.indexOf("_show"))
.concat(["_rewrite"]).join("/")
}
- var h = "http://" + req.headers.Host + "/"
+ var h = "http://" + req.headers.Host
doc.versions[v].dist.tarball = h + basePath + t
}

0 comments on commit fb407a7

Please sign in to comment.