Remove CDN fallback logic (v1)

This commit is contained in:
Zachary Taylor 2025-01-02 00:21:29 +00:00
parent 71a4fd9b27
commit c1da47a992
2 changed files with 4 additions and 17 deletions

10
dist/index.js vendored
View File

@ -18168,13 +18168,8 @@ class DotnetCoreInstaller {
} }
getReleasesJsonUrl(httpClient, versionParts) { getReleasesJsonUrl(httpClient, versionParts) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let response; const response = yield httpClient.getJson(DotNetCoreIndexUrl);
try {
response = yield httpClient.getJson(DotNetCoreIndexUrl);
}
catch (error) {
response = yield httpClient.getJson(DotnetCoreIndexFallbackUrl);
}
const result = response.result || {}; const result = response.result || {};
let releasesInfo = result['releases-index']; let releasesInfo = result['releases-index'];
releasesInfo = releasesInfo.filter((info) => { releasesInfo = releasesInfo.filter((info) => {
@ -18199,7 +18194,6 @@ class DotnetCoreInstaller {
} }
exports.DotnetCoreInstaller = DotnetCoreInstaller; exports.DotnetCoreInstaller = DotnetCoreInstaller;
const DotNetCoreIndexUrl = 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json'; const DotNetCoreIndexUrl = 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
const DotnetCoreIndexFallbackUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
/***/ }), /***/ }),

View File

@ -261,12 +261,8 @@ export class DotnetCoreInstaller {
httpClient: hc.HttpClient, httpClient: hc.HttpClient,
versionParts: string[] versionParts: string[]
): Promise<string> { ): Promise<string> {
let response; const response = await httpClient.getJson<any>(DotNetCoreIndexUrl);
try {
response = await httpClient.getJson<any>(DotNetCoreIndexUrl);
} catch (error) {
response = await httpClient.getJson<any>(DotnetCoreIndexFallbackUrl);
}
const result = response.result || {}; const result = response.result || {};
let releasesInfo: any[] = result['releases-index']; let releasesInfo: any[] = result['releases-index'];
@ -306,6 +302,3 @@ export class DotnetCoreInstaller {
const DotNetCoreIndexUrl: string = const DotNetCoreIndexUrl: string =
'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json'; 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
const DotnetCoreIndexFallbackUrl: string =
'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';