Skip to content

Commit c31af44

Browse files
committed
Throw error if dataset is not set (to avoid obscure error messages)
1 parent fbe9891 commit c31af44

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • src/middleware/packages/webacl/middlewares

src/middleware/packages/webacl/middlewares/webacl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ const WebAclMiddleware = ({ baseUrl, podProvider = false, graphName = 'http://se
380380
const webId = ctx.params.webId || ctx.meta.webId || 'anon';
381381
const dataset = ctx.params.dataset || ctx.meta.dataset;
382382

383+
if (!dataset) throw new Error(`The dataset param or meta is missing when calling ${action.name}`);
384+
383385
// If the webId is the owner of the Pod, bypass WAC checks
384386
if (urlJoin(baseUrl, dataset) === webId) {
385387
ctx.params.webId = 'system';

0 commit comments

Comments
 (0)