File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,10 @@ function allow (mode) {
7272 }
7373 }
7474
75- // check user is owner. Check isOwner from /.meta
76- if ( resourceUrl . endsWith ( '.acl' ) && await ldp . isOwner ( userId , req . hostname ) ) return next ( )
77-
75+ // check if user is owner. Check isOwner from /.meta
76+ try {
77+ if ( resourceUrl . endsWith ( '.acl' ) && ( await ldp . isOwner ( userId , req . hostname ) ) ) return next ( )
78+ } catch ( err ) { }
7879 const error = req . authError || await req . acl . getError ( userId , mode )
7980 debug ( `${ mode } access denied to ${ userId || '(none)' } : ${ error . status } - ${ error . message } ` )
8081 next ( error )
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ describe('LDP', function () {
9797 assert . equal ( isOwner , true )
9898 } )
9999 } )
100+ it ( 'should return acl:owner false' , ( ) => {
101+ const owner = 'https://tim.localhost:7777/profile/card'
102+ return ldp . isOwner ( owner , '/resources/' )
103+ . then ( isOwner => {
104+ assert . equal ( isOwner , false )
105+ } )
106+ } )
100107 } )
101108 describe ( 'getGraph' , ( ) => {
102109 it ( 'should read and parse an existing file' , ( ) => {
You can’t perform that action at this time.
0 commit comments