Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit b0c5bf8

Browse files
authored
feat: expand allowed protocols for URLs in repository component (#412)
1 parent 990f749 commit b0c5bf8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pages/Version/DetailSidebar/Repository/Repository.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('<Repository /> component', () => {
5757
...detailContextValue.packageMeta?.latest,
5858
repository: {
5959
type: 'git',
60-
url: 'git://github.com/verdaccio/ui.git',
60+
url: 'invalid://github.com/verdaccio/ui.git',
6161
},
6262
},
6363
};

src/utils/url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import '../../types';
44

55
export function isURL(url: string): boolean {
66
return isURLValidator(url || '', {
7-
protocols: ['http', 'https', 'git+https'],
7+
protocols: ['git', 'git+ssh', 'git+http', 'git+https', 'git+file', 'http', 'https'],
88
require_protocol: true,
99
require_tld: false,
1010
});

0 commit comments

Comments
 (0)