Skip to content

Commit 6bda3e8

Browse files
committed
Add the serverUri as trusted origin for multiuser
1 parent 899f130 commit 6bda3e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/handlers/allow.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ function allow (mode, checkPermissionsForDirectory) {
4343
resourcePath += '/'
4444
}
4545

46+
let trustedOrigins = [ldp.resourceMapper.resolveUrl(req.hostname)].concat(ldp.trustedOrigins)
47+
if (ldp.multiuser) {
48+
trustedOrigins.push(ldp.serverUri)
49+
}
4650
// Obtain and store the ACL of the requested resource
4751
req.acl = new ACL(rootUrl + resourcePath, {
4852
agentOrigin: req.get('origin'),
@@ -56,7 +60,7 @@ function allow (mode, checkPermissionsForDirectory) {
5660
},
5761
suffix: ldp.suffixAcl,
5862
strictOrigin: ldp.strictOrigin,
59-
trustedOrigins: [ldp.resourceMapper.resolveUrl(req.hostname)].concat(ldp.trustedOrigins)
63+
trustedOrigins: trustedOrigins
6064
})
6165

6266
// Ensure the user has the required permission

0 commit comments

Comments
 (0)