Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
base
};
});
if (files.length === 0) {
return false;
}
const directory = `/${prefix}`;
const paths = [
{
name: directory,
url: requestPath
}
];
const directoryHtml = directoryTemplate({
files,
paths,
directory
});
this.setResponseHeaders(res, nowRequestId);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader(
'Content-Length',
String(Buffer.byteLength(directoryHtml, 'utf8'))
);
res.end(directoryHtml);
return true;
}
base,
};
});
if (files.length === 0) {
return false;
}
const directory = `/${prefix}`;
const paths = [
{
name: directory,
url: requestPath,
},
];
const directoryHtml = directoryTemplate({
files,
paths,
directory,
});
this.setResponseHeaders(res, nowRequestId);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader(
'Content-Length',
String(Buffer.byteLength(directoryHtml, 'utf8'))
);
res.end(directoryHtml);
return true;
}
base,
};
});
if (files.length === 0) {
return false;
}
const directory = `/${prefix}`;
const paths = [
{
name: directory,
url: requestPath,
},
];
const directoryHtml = directoryTemplate({
files,
paths,
directory,
});
this.setResponseHeaders(res, nowRequestId);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader(
'Content-Length',
String(Buffer.byteLength(directoryHtml, 'utf8'))
);
res.end(directoryHtml);
return true;
}