fix(installer): preserve encoded ssh auth
This commit is contained in:
parent
16ff771941
commit
c5f7de38e2
|
|
@ -227,6 +227,16 @@ console.log(`\n${colors.cyan}Simple owner/repo URLs (regression check)${colors.r
|
|||
assert(result.cacheKey === 'host:2222/path/repo', 'SSH protocol query/hash cacheKey ignores query and hash', `Got: ${result.cacheKey}`);
|
||||
}
|
||||
|
||||
{
|
||||
const result = manager.parseSource('ssh://git%40corp@host:2222/path/repo.git?foo=bar#readme');
|
||||
assert(result.isValid === true, 'SSH protocol URL with encoded username is valid');
|
||||
assert(
|
||||
result.cloneUrl === 'ssh://git%40corp@host:2222/path/repo.git',
|
||||
'SSH protocol cloneUrl preserves encoded username',
|
||||
`Got: ${result.cloneUrl}`,
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const result = manager.parseSource('ssh://git@host/owner/repo.git');
|
||||
assert(result.isValid === true, 'SSH protocol URL without custom port remains valid');
|
||||
|
|
|
|||
|
|
@ -171,8 +171,9 @@ class CustomModuleManager {
|
|||
const repoSeg = segments.at(-1);
|
||||
const ownerSeg = segments.at(-2);
|
||||
const displayName = ownerSeg ? `${ownerSeg}/${repoSeg}` : repoSeg;
|
||||
const auth = url.username ? `${url.username}${url.password ? `:${url.password}` : ''}@` : '';
|
||||
const cloneUrl = `${url.protocol}//${auth}${url.host}/${repoPath}`;
|
||||
url.search = '';
|
||||
url.hash = '';
|
||||
const cloneUrl = url.toString();
|
||||
|
||||
return {
|
||||
type: 'url',
|
||||
|
|
|
|||
Loading…
Reference in New Issue