Skip to content

Commit

Permalink
Merge pull request #143 from thiagobustamante/master
Browse files Browse the repository at this point in the history
Fix #138
  • Loading branch information
thiagobustamante committed May 28, 2018
2 parents 2cf7cb0 + 4d5caae commit cb07b93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tree-gateway",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "http://treegateway.org",
"description": "The Tree Gateway API Gateway",
"author": "Thiago da Rosa de Bustamante <trbustamante@gmail.com>",
Expand Down
11 changes: 10 additions & 1 deletion src/pipeline/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@ export function buildGroupDenyTest(request: string, groups: Array<Group>, names:
if (i > 0) {
func.push(`&&`);
}
func.push(`!(mm.isMatch(${request}.path, '${normalizePath(path)}'))`);
if (path && path.indexOf('&') > 0) {
const expressions = path.split('&')
.map(p => normalizePath(p))
.filter(p => p.trim().length > 0)
.map(p => `'${p}'`)
.join(',');
func.push(`!(mm.all(${request}.path, [${expressions}]))`);
} else {
func.push(`!(mm.isMatch(${request}.path, '${normalizePath(path)}'))`);
}
});
func.push(`)`);
}
Expand Down

0 comments on commit cb07b93

Please sign in to comment.