From 42209d235d9bc786ec78d7df0669d9fb2d3f3349 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 21 Nov 2025 09:17:35 +0000 Subject: [PATCH] fix(maven): Pass request path to Maven checksum handler so checksum files are resolved correctly --- changelog.md | 7 +++++++ test/test.maven.ts | 8 ++++++++ ts/00_commitinfo_data.ts | 2 +- ts/maven/classes.mavenregistry.ts | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 8424a01..85c3126 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-11-21 - 1.3.1 - fix(maven) +Pass request path to Maven checksum handler so checksum files are resolved correctly + +- Call handleChecksumRequest with the full request path from MavenRegistry.handleRequest +- Allows getChecksum to extract the checksum filename from the URL and fetch the correct checksum file from storage +- Fixes 404s when requesting artifact checksum files (md5, sha1, sha256, sha512) + ## 2025-11-21 - 1.3.0 - feat(core) Add Cargo and Composer registries with storage, auth and helpers diff --git a/test/test.maven.ts b/test/test.maven.ts index 686ac68..2666d5a 100644 --- a/test/test.maven.ts +++ b/test/test.maven.ts @@ -30,6 +30,14 @@ tap.test('Maven: should create registry instance', async () => { expect(registry).toBeInstanceOf(SmartRegistry); expect(mavenToken).toBeTypeOf('string'); + + // Clean up any existing metadata from previous test runs + const storage = registry.getStorage(); + try { + await storage.deleteMavenMetadata(testGroupId, testArtifactId); + } catch (error) { + // Ignore error if metadata doesn't exist + } }); tap.test('Maven: should upload POM file (PUT /{groupPath}/{artifactId}/{version}/*.pom)', async () => { diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 415041a..d7ede27 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartregistry', - version: '1.3.0', + version: '1.3.1', description: 'a registry for npm modules and oci images' } diff --git a/ts/maven/classes.mavenregistry.ts b/ts/maven/classes.mavenregistry.ts index fe3370d..f717b53 100644 --- a/ts/maven/classes.mavenregistry.ts +++ b/ts/maven/classes.mavenregistry.ts @@ -85,7 +85,7 @@ export class MavenRegistry extends BaseRegistry { // Check if it's a checksum file if (coordinate.extension === 'md5' || coordinate.extension === 'sha1' || coordinate.extension === 'sha256' || coordinate.extension === 'sha512') { - return this.handleChecksumRequest(context.method, coordinate, token); + return this.handleChecksumRequest(context.method, coordinate, token, path); } // Handle artifact requests (JAR, POM, WAR, etc.)