Files
renovate/lib/modules/datasource/maven/common.ts
Jamie Tanna 2832648dda fix(datasource/maven): treat rate-limit errors for Maven Central mirror as Maven Central (#43432)
In 01bcd4fd43 we introduced knowledge of
the Maven Central mirror, but haven't taken it into account when looking
at rate limit errors.

To prevent this in the future, we can introduce a new helper function,
`isMavenCentral`, for other usage.
2026-05-18 15:43:33 +00:00

17 lines
521 B
TypeScript

import { parseUrl } from '../../../util/url.ts';
export const id = 'maven';
export const MAVEN_REPO = 'https://repo.maven.apache.org/maven2';
export const MAVEN_CENTRAL_MIRROR = 'https://repo1.maven.org/maven2';
export const MAVEN_CENTRAL_URLS = [MAVEN_REPO, MAVEN_CENTRAL_MIRROR];
function getHost(url: string): string | undefined {
return parseUrl(url)?.host;
}
export function isMavenCentral(url: string): boolean {
return MAVEN_CENTRAL_URLS.some(
(mavenRepo) => getHost(url) === getHost(mavenRepo),
);
}