@eonasdan/parvus-server
Advanced tools
Comparing version 1.1.7 to 1.1.9
@@ -62,3 +62,3 @@ 'use strict'; | ||
this.subfolder = config.subfolder; | ||
config.middlewares.forEach(x => this.addMiddleware(x.middleware, x.route)); | ||
config.middlewares?.forEach(x => this.addMiddleware(x.middleware, x.route)); | ||
} | ||
@@ -100,3 +100,3 @@ } | ||
const next = generateNext(); | ||
const matching = this.middlewares.filter(x => x.pattern.test(req.url)).map(x => x.middleware); | ||
const matching = this.middlewares?.filter(x => x.pattern.test(req.url)).map(x => x.middleware); | ||
for (let middleware of matching) { | ||
@@ -141,3 +141,8 @@ next.reset(); | ||
const filePath = path__namespace.join(directory, url); | ||
let fileExists = await fs.promises.stat(filePath); | ||
let fileExists = null; | ||
try { | ||
fileExists = await fs.promises.stat(filePath); | ||
} | ||
catch { | ||
} | ||
if (!fileExists) { | ||
@@ -144,0 +149,0 @@ res.statusCode = 404; |
{ | ||
"name": "@eonasdan/parvus-server", | ||
"version": "1.1.7", | ||
"version": "1.1.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/server.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112544
5044