Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-01-08 01:04:50 +0300
committerisaacs <i@izs.me>2011-01-08 01:04:50 +0300
commite8823b3b66c2c369add808fd388410881993529a (patch)
treedcf8dec929cbefd0263279351db11091b696def5
parent9b395ed180372734e83eb74751514204dc3abcd0 (diff)
Support for non-root registry URLs
-rw-r--r--lib/utils/registry/request.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/utils/registry/request.js b/lib/utils/registry/request.js
index a5bd9085b..489e6ff0d 100644
--- a/lib/utils/registry/request.js
+++ b/lib/utils/registry/request.js
@@ -33,7 +33,8 @@ function request (method, where, what, etag, nofollow, cb) {
|| where.match(adduserChange)
|| method === "DELETE"
if (!where.match(/^https?:\/\//)) {
- where = where.split("/").map(function (p) {
+ if (where.charAt(0) !== "/") where = "/" + where
+ where = "." + where.split("/").map(function (p) {
p = p.trim()
if (p.match(/^org.couchdb.user/)) {
return p.replace(/\//g, encodeURIComponent("/"))