File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,10 @@ function allow (mode) {
72
72
}
73
73
}
74
74
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 ) { }
78
79
const error = req . authError || await req . acl . getError ( userId , mode )
79
80
debug ( `${ mode } access denied to ${ userId || '(none)' } : ${ error . status } - ${ error . message } ` )
80
81
next ( error )
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ describe('LDP', function () {
97
97
assert . equal ( isOwner , true )
98
98
} )
99
99
} )
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
+ } )
100
107
} )
101
108
describe ( 'getGraph' , ( ) => {
102
109
it ( 'should read and parse an existing file' , ( ) => {
You can’t perform that action at this time.
0 commit comments