mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
fix(api): fix scope handling in package routes (#5006)
The changes in #5000 breaks package scopes
This commit is contained in:
parent
e841cbe44d
commit
cc63799d5a
1 changed files with 3 additions and 5 deletions
|
@ -120,8 +120,7 @@ function addPackageWebApi(pkgRouter: Router, storage: Storage, auth: Auth, confi
|
|||
],
|
||||
can('access'),
|
||||
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
||||
const rawScope = req.params.scope; // May include '@'
|
||||
const scope = rawScope ? rawScope.slice(1) : null; // Remove '@' if present
|
||||
const scope = req.params.scope;
|
||||
const packageName = scope ? addScope(scope, req.params.package) : req.params.package;
|
||||
|
||||
storage.getPackage({
|
||||
|
@ -141,11 +140,10 @@ function addPackageWebApi(pkgRouter: Router, storage: Storage, auth: Auth, confi
|
|||
);
|
||||
|
||||
pkgRouter.get(
|
||||
['/-/verdaccio/data/sidebar/:scope/:package', '/-/verdaccio/data/sidebar/: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 '@'
|
||||
const scope = rawScope ? rawScope.slice(1) : null; // Remove '@' if present
|
||||
const scope = req.params.scope;
|
||||
const packageName: string = scope ? addScope(scope, req.params.package) : req.params.package;
|
||||
|
||||
storage.getPackage({
|
||||
|
|
Loading…
Reference in a new issue