mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 22:50:17 +08:00
Use GITHUB_DOTCOM_URL so URL deduplication works
This commit is contained in:
@@ -125,15 +125,15 @@ test("getExtraOptionsEnvParam() fails on invalid JSON", (t) => {
|
||||
});
|
||||
|
||||
test("parseGithubUrl", (t) => {
|
||||
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com/");
|
||||
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com/");
|
||||
t.deepEqual(util.parseGithubUrl("github.com"), "https://github.com");
|
||||
t.deepEqual(util.parseGithubUrl("https://github.com"), "https://github.com");
|
||||
t.deepEqual(
|
||||
util.parseGithubUrl("https://api.github.com"),
|
||||
"https://github.com/"
|
||||
"https://github.com"
|
||||
);
|
||||
t.deepEqual(
|
||||
util.parseGithubUrl("https://github.com/foo/bar"),
|
||||
"https://github.com/"
|
||||
"https://github.com"
|
||||
);
|
||||
|
||||
t.deepEqual(
|
||||
|
||||
@@ -189,7 +189,7 @@ export function parseGithubUrl(inputUrl: string): string {
|
||||
// If we detect this is trying to be to github.com
|
||||
// then return with a fixed canonical URL.
|
||||
if (url.hostname === "github.com" || url.hostname === "api.github.com") {
|
||||
return "https://github.com/";
|
||||
return GITHUB_DOTCOM_URL;
|
||||
}
|
||||
|
||||
// Remove the API prefix if it's present
|
||||
|
||||
Reference in New Issue
Block a user