Skip to content

Commit

Permalink
Use constant for default download uri
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Oct 1, 2024
1 parent 9eb3aaf commit 84fc8bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { DEFAULT_DOWNLOAD_SOURCE_URI } from '../../../../common/constants';
import type { DownloadSource, FleetProxy } from '../../../types';

function getfleetServerHostsEnrollArgs(
Expand All @@ -24,9 +25,8 @@ function getfleetServerHostsEnrollArgs(
}

export const getDownloadBaseUrl = (downloadSource?: DownloadSource) => {
return downloadSource?.host.endsWith('/')
? downloadSource.host.substring(0, downloadSource.host.length - 1)
: 'https://artifacts.elastic.co/downloads';
const source = downloadSource?.host || DEFAULT_DOWNLOAD_SOURCE_URI;
return source.endsWith('/') ? source.substring(0, source.length - 1) : source;
};

export const getDownloadSourceProxyArgs = (downloadSourceProxy?: FleetProxy) => {
Expand Down

0 comments on commit 84fc8bf

Please sign in to comment.