|
1 | 1 | import {Configuration, Locator, execUtils, structUtils, httpUtils} from '@yarnpkg/core'; |
2 | 2 | import {npath, xfs} from '@yarnpkg/fslib'; |
| 3 | +import GitUrlParse from 'git-url-parse'; |
3 | 4 | import querystring from 'querystring'; |
4 | 5 | import semver from 'semver'; |
5 | 6 | import urlLib from 'url'; |
@@ -170,7 +171,7 @@ export function normalizeLocator(locator: Locator) { |
170 | 171 | export async function lsRemote(repo: string, configuration: Configuration) { |
171 | 172 | const normalizedRepoUrl = normalizeRepoUrl(repo, {git: true}); |
172 | 173 |
|
173 | | - const networkSettings = httpUtils.getNetworkSettings(normalizedRepoUrl, {configuration}); |
| 174 | + const networkSettings = httpUtils.getNetworkSettings(`https://${GitUrlParse(normalizedRepoUrl).resource}`, {configuration}); |
174 | 175 | if (!networkSettings.enableNetwork) |
175 | 176 | throw new Error(`Request to '${normalizedRepoUrl}' has been blocked because of your configuration settings`); |
176 | 177 |
|
@@ -298,7 +299,7 @@ export async function clone(url: string, configuration: Configuration) { |
298 | 299 | throw new Error(`Invalid treeish protocol when cloning`); |
299 | 300 |
|
300 | 301 | const normalizedRepoUrl = normalizeRepoUrl(repo, {git: true}); |
301 | | - if (httpUtils.getNetworkSettings(normalizedRepoUrl, {configuration}).enableNetwork === false) |
| 302 | + if (httpUtils.getNetworkSettings(`https://${GitUrlParse(normalizedRepoUrl).resource}`, {configuration}).enableNetwork === false) |
302 | 303 | throw new Error(`Request to '${normalizedRepoUrl}' has been blocked because of your configuration settings`); |
303 | 304 |
|
304 | 305 | const directory = await xfs.mktempPromise(); |
|
0 commit comments