1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00

Merge pull request #261 from verdaccio/fix_scoped_package_detail_and_leaks

Detail page can't handle scoped package
This commit is contained in:
Juan Picado @jotadeveloper 2017-07-24 12:40:32 +02:00 committed by GitHub
commit fb7863439e
2 changed files with 7 additions and 2 deletions

@ -105,7 +105,12 @@ module.exports.allow = function(auth) {
return function(action) {
return function(req, res, next) {
req.pause();
auth['allow_' + action](req.params.package, req.remote_user, function(error, allowed) {
let packageName = req.params.package;
if (req.params.scope) {
packageName = `@${req.params.scope}/${packageName}`;
}
auth['allow_' + action](packageName, req.remote_user, function(error, allowed) {
req.resume();
if (error) {
next(error);

@ -13,7 +13,7 @@ const RouterApp = () => {
<div className="container">
<Switch>
<Route exact path="/(search/:keyword)?" component={ Home } />
<Route path="/detail/:package" component={Detail} />
<Route path="/detail/:package*" component={Detail} />
</Switch>
</div>
</div>