From b9df86f0803a24bce1e483b8305ce67eef0c7f58 Mon Sep 17 00:00:00 2001 From: Jon Sharratt Date: Tue, 11 Oct 2016 19:41:54 +0100 Subject: [PATCH] Fix custom registries with paths Ensures with and without trailing / registry url is correct and resolvable. --- src/registries/npm-registry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/registries/npm-registry.js b/src/registries/npm-registry.js index 7a3fd695fd..5f166f8fdb 100644 --- a/src/registries/npm-registry.js +++ b/src/registries/npm-registry.js @@ -54,8 +54,11 @@ export default class NpmRegistry extends Registry { headers.authorization = `Bearer ${this.token}`; } + // $FlowFixMe : https://github.com/facebook/flow/issues/908 + const requestUrl = url.format(`${registry}/${pathname}`); + return this.requestManager.request({ - url: url.resolve(registry, pathname), + url: requestUrl, method: opts.method, body: opts.body, auth: opts.auth,