0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fix: #4984 improved paths for web endpoint (#5000)

* fix: array web url endpoints

* Update package.ts
This commit is contained in:
Juan Picado 2024-12-15 09:41:46 +01:00 committed by GitHub
parent e3f3825905
commit fb8b2c40aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,7 +114,10 @@ function addPackageWebApi(pkgRouter: Router, storage: Storage, auth: Auth, confi
// Get package readme
pkgRouter.get(
'/-/verdaccio/data/package/readme/:scope(@[^/]+)?/:package/:version?',
[
'/-/verdaccio/data/package/readme/@:scope/:package/:version?',
'/-/verdaccio/data/package/readme/:package/:version?',
],
can('access'),
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
const rawScope = req.params.scope; // May include '@'
@ -138,7 +141,7 @@ function addPackageWebApi(pkgRouter: Router, storage: Storage, auth: Auth, confi
);
pkgRouter.get(
'/-/verdaccio/data/sidebar/:scope(@[^/]+)?/:package',
['/-/verdaccio/data/sidebar/:scope/:package', '/-/verdaccio/data/sidebar/:package'],
can('access'),
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
const rawScope = req.params.scope; // May include '@'