Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(maven): Fetch "last-modified" timestamps from all hosts #9795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/datasource/maven/__snapshots__/index.spec.ts.snap
Expand Up @@ -558,9 +558,11 @@ Object {
"registryUrl": "https://custom.registry.renovatebot.com",
"releases": Array [
Object {
"releaseTimestamp": "2020-01-01T01:00:00.000Z",
"version": "1.0.0",
},
Object {
"releaseTimestamp": "2020-01-01T02:00:00.000Z",
"version": "2.0.0",
},
],
Expand Down
8 changes: 2 additions & 6 deletions lib/datasource/maven/util.ts
Expand Up @@ -115,12 +115,8 @@ export async function isHttpResourceExists(
try {
const httpClient = httpByHostType(hostType);
const res = await httpClient.head(pkgUrl.toString());
const pkgUrlHost = url.parse(pkgUrl.toString()).host;
if (['repo.maven.apache.org', 'gitlab.com'].includes(pkgUrlHost)) {
const timestamp = res?.headers?.['last-modified'] as string;
return timestamp || true;
}
return true;
const timestamp = res?.headers?.['last-modified'] as string;
viceice marked this conversation as resolved.
Show resolved Hide resolved
return timestamp || true;
} catch (err) {
if (isNotFoundError(err)) {
return false;
Expand Down