File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,13 @@ function allow (mode, checkPermissionsForDirectory) {
5757 // This is a hack to make NSS check the ACL for representation that is served for root (if any)
5858 // See https://github.com/solid/node-solid-server/issues/1063 for more info
5959 const representationUrl = await ldp . resourceMapper . getRepresentationUrlForResource ( resourceUrl )
60- req . acl = ACL . createFromLDPAndRequest ( representationUrl , ldp , req )
61- const representationIsAllowed = await req . acl . can ( userId , mode )
62- if ( representationIsAllowed ) {
63- return next ( )
60+ if ( representationUrl . endsWith ( 'index.html' ) ) {
61+ // We ONLY want to do this when the representation we return is a HTML file
62+ req . acl = ACL . createFromLDPAndRequest ( representationUrl , ldp , req )
63+ const representationIsAllowed = await req . acl . can ( userId , mode )
64+ if ( representationIsAllowed ) {
65+ return next ( )
66+ }
6467 }
6568 }
6669 const error = await req . acl . getError ( userId , mode )
You can’t perform that action at this time.
0 commit comments