solid-server 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ldp.js +1 -1
- package/lib/resource-mapper.js +4 -2
- package/package.json +1 -1
package/lib/ldp.js
CHANGED
|
@@ -459,7 +459,7 @@ class LDP {
|
|
|
459
459
|
({ path, contentType } = await this.resourceMapper.mapUrlToFile({ url: options, searchIndex }))
|
|
460
460
|
stats = await this.stat(path)
|
|
461
461
|
} catch (err) {
|
|
462
|
-
throw error(
|
|
462
|
+
throw error(err.status || 500, err.message)
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
// Just return, since resource exists
|
package/lib/resource-mapper.js
CHANGED
|
@@ -125,7 +125,7 @@ class ResourceMapper {
|
|
|
125
125
|
|
|
126
126
|
// Find a file with the same name (minus the dollar extension)
|
|
127
127
|
let match = ''
|
|
128
|
-
|
|
128
|
+
try {
|
|
129
129
|
const files = await this._readdir(folder)
|
|
130
130
|
// Search for files with the same name (disregarding a dollar extension)
|
|
131
131
|
if (!isFolder) {
|
|
@@ -134,13 +134,15 @@ class ResourceMapper {
|
|
|
134
134
|
} else if (searchIndex && files.includes(this._indexFilename)) {
|
|
135
135
|
match = this._indexFilename
|
|
136
136
|
}
|
|
137
|
+
} catch (err) {
|
|
138
|
+
throw new HTTPError(404, `${filePath} Resource not found`)
|
|
137
139
|
}
|
|
138
140
|
// Error if no match was found (unless URL ends with '/', then fall back to the folder)
|
|
139
141
|
if (match === undefined) {
|
|
140
142
|
if (isIndex) {
|
|
141
143
|
match = ''
|
|
142
144
|
} else {
|
|
143
|
-
throw new HTTPError(404,
|
|
145
|
+
throw new HTTPError(404, `${pathname} Resource not found`)
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
path = `${folder}${match}`
|