We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18ce5c2 commit a5b4041Copy full SHA for a5b4041
ui/src/app/shared/components/urls.ts
@@ -1,5 +1,6 @@
1
import {GitUrl} from 'git-url-parse';
2
import {isSHA} from './revision';
3
+import {isValidURL} from '../../shared/utils';
4
5
const GitUrlParse = require('git-url-parse');
6
@@ -19,7 +20,11 @@ export function repoUrl(url: string): string {
19
20
return null;
21
}
22
- return `${protocol(parsed.protocol)}://${parsed.resource}/${parsed.owner}/${parsed.name}`;
23
+ const parsedUrl = `${protocol(parsed.protocol)}://${parsed.resource}/${parsed.owner}/${parsed.name}`;
24
+ if (!isValidURL(parsedUrl)) {
25
+ return null;
26
+ }
27
+ return parsedUrl;
28
} catch {
29
30
0 commit comments