Socket
Socket
Sign inDemoInstall

serve-handler

Package Overview
Dependencies
19
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

2

package.json
{
"name": "serve-handler",
"version": "2.1.0",
"version": "2.1.1",
"description": "The routing foundation of `serve` and static deployments on Now",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -253,9 +253,13 @@ // Native

const renderDirectory = async (current, relativePath, absolutePath, {readdir, stat}) => {
let files = await readdir(absolutePath);
const renderDirectory = async (current, relativePath, absolutePath, handlers, config) => {
if (!applicable(relativePath, config.directoryListing, false)) {
return null;
}
let files = await handlers.readdir(absolutePath);
for (const file of files) {
const filePath = path.resolve(absolutePath, file);
const details = path.parse(filePath);
const stats = await stat(filePath);
const stats = await handlers.stat(filePath);

@@ -413,15 +417,6 @@ details.relative = path.join(relativePath, details.base);

const canList = applicable(decodedPath, config.directoryListing, false);
if (!canList) {
response.statusCode = 404;
response.end('Not Found');
return;
}
let directory = null;
try {
directory = await renderDirectory(current, relativePath, absolutePath, handlers);
directory = await renderDirectory(current, relativePath, absolutePath, handlers, config);
} catch (err) {

@@ -434,4 +429,4 @@ response.statusCode = 500;

response.statusCode = 200;
response.end(directory);
response.statusCode = directory ? 200 : 404;
response.end(directory || 'Not Found');
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc