Skip to content

Commit

Permalink
Fix private urls using colon separator
Browse files Browse the repository at this point in the history
Closes #573, closes #2416.

Related to #2384, #573.
  • Loading branch information
Balthazar Gronon committed Jan 20, 2017
1 parent ddb9fa8 commit 7efb32a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/resolvers/exotics/git-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ExoticResolver from './exotic-resolver.js';
import Git from '../../util/git.js';

const urlParse = require('url').parse;
const urlFormat = require('url').format;

// we purposefully omit https and http as those are only valid if they end in the .git extension
const GIT_PROTOCOLS = ['git:', 'git+ssh:', 'git+https:', 'ssh:'];
Expand Down Expand Up @@ -92,7 +93,9 @@ export default class GitResolver extends ExoticResolver {
}

const {config} = this;
const client = new Git(config, url, this.hash);

parts.pathname = parts.pathname.replace(/^\/:/, '/');
const client = new Git(config, urlFormat(parts), this.hash);
const commit = await client.init();

async function tryRegistry(registry): Promise<?Manifest> {
Expand Down

0 comments on commit 7efb32a

Please sign in to comment.