From d952d2795ad742be2fb4e15146a2ee1194d29dbf Mon Sep 17 00:00:00 2001 From: "i18n.site" Date: Thu, 17 Oct 2024 17:33:47 +0800 Subject: [PATCH] Update PackageVersionFileController.ts fix https://github.com/cnpm/cnpmcore/issues/696 --- app/port/controller/PackageVersionFileController.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/port/controller/PackageVersionFileController.ts b/app/port/controller/PackageVersionFileController.ts index d68db1ed..8881ed0e 100644 --- a/app/port/controller/PackageVersionFileController.ts +++ b/app/port/controller/PackageVersionFileController.ts @@ -170,6 +170,18 @@ export class PackageVersionFileController extends AbstractController { } return await this.distRepository.getDistStream(file.dist); } + + @HTTPMethod({ + path: `/:fullname@versionSpec/:path(.+)`, + method: HTTPMethodEnum.GET, + }) + async rawNpm(@Context() ctx: EggContext, + @HTTPParam() fullname: string, + @HTTPParam() versionSpec: string, + @HTTPParam() path: string, + @HTTPQuery() meta: string) { + return await this.raw(ctx, fullname, versionSpec, filepath, meta); + } /** * compatibility with unpkg