Skip to content

Commit 28fdc98

Browse files
authored
Merge pull request #469 from github/alert-autofix-6
Potential fix for code scanning alert no. 6: Incomplete URL substring sanitization
2 parents 1df9684 + 76ce8b7 commit 28fdc98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/git/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function getGitHubUrls(): Promise<GitHubUrls[] | null> {
7878
remote.length > 0 &&
7979
(remote[0].pushUrl?.indexOf("github.com") !== -1 ||
8080
(useEnterprise() && remote[0].pushUrl?.indexOf(new URL(getGitHubApiUri()).host) !== -1) ||
81-
remote[0].pushUrl?.indexOf(".ghe.com") !== -1)
81+
(remote[0].pushUrl ? new URL(remote[0].pushUrl).host.endsWith(".ghe.com") : false))
8282
) {
8383
const url = remote[0].pushUrl;
8484

0 commit comments

Comments
 (0)