Skip to content

Commit d3e6506

Browse files
committed
Now excluding both .acl- and .meta-files when finding default file
1 parent 218b36a commit d3e6506

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/create-app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ function createApp (argv = {}) {
4949
rootPath: path.resolve(argv.root || process.cwd()),
5050
includeHost: argv.multiuser,
5151
defaultContentType: argv.defaultContentType,
52-
fileSuffixes: {
53-
acl: argv.suffixAcl || '.acl',
54-
meta: argv.suffixMeta || '.meta'
55-
}
52+
fileSuffixes: [
53+
argv.suffixAcl || '.acl',
54+
argv.suffixMeta || '.meta'
55+
]
5656
})
5757

5858
const configPath = config.initConfigDir(argv)

lib/resource-mapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ResourceMapper {
1616
defaultContentType = 'application/octet-stream',
1717
indexFilename = 'index',
1818
overrideTypes = { acl: 'text/turtle', meta: 'text/turtle' },
19-
fileSuffixes = { acl: '.acl', meta: '.meta' }
19+
fileSuffixes = ['.acl', '.meta']
2020
}) {
2121
this._rootUrl = this._removeTrailingSlash(rootUrl)
2222
this._rootPath = this._removeTrailingSlash(rootPath)
@@ -95,7 +95,7 @@ class ResourceMapper {
9595

9696
// Find a file with the same name (minus the dollar extension)
9797
return (files.find(f => this._removeDollarExtension(f) === filename ||
98-
(isIndex && f.startsWith(this._indexFilename + '.') && !f.endsWith(this._suffixes.acl))))
98+
(isIndex && f.startsWith(this._indexFilename + '.') && !this._suffixes.some(suffix => f.endsWith(suffix)))))
9999
}
100100

101101
async getRepresentationUrlForResource (resourceUrl) {

0 commit comments

Comments
 (0)