@jnode/server 1.0.5 → 1.0.6
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/package.json +1 -1
- package/src/final.js +3 -1
package/package.json
CHANGED
package/src/final.js
CHANGED
|
@@ -92,7 +92,9 @@ async function processFinal(req, res, map, p, e) {
|
|
|
92
92
|
|
|
93
93
|
//get file size and check file exists
|
|
94
94
|
try {
|
|
95
|
-
|
|
95
|
+
const stat = await fsPromises.stat(file);
|
|
96
|
+
if (stat.isDirectory()) return '!404'; //return error for directory
|
|
97
|
+
fileSize = stat.size;
|
|
96
98
|
} catch (err) { return '!404'; } //return error
|
|
97
99
|
|
|
98
100
|
//write head
|