serve-handler
Advanced tools
Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "serve-handler", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "The routing foundation of `serve` and static deployments on Now", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -477,4 +477,12 @@ // Native | ||
if (stats) { | ||
let stream = null; | ||
try { | ||
stream = await handlers.createReadStream(errorPage); | ||
} catch (err) { | ||
// eslint-disable-next-line no-use-before-define | ||
return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err); | ||
} | ||
const headers = await getHeaders(config.headers, current, errorPage, stats); | ||
const stream = await handlers.createReadStream(errorPage); | ||
@@ -678,3 +686,10 @@ response.writeHead(statusCode, headers); | ||
const stream = await handlers.createReadStream(absolutePath, streamOpts); | ||
let stream = null; | ||
try { | ||
stream = await handlers.createReadStream(absolutePath, streamOpts); | ||
} catch (err) { | ||
return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err); | ||
} | ||
const headers = await getHeaders(config.headers, current, absolutePath, stats); | ||
@@ -681,0 +696,0 @@ |
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
41169
610