Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return createServer((req, res) => {
const [, fixture, query] = /^\/([^?]+)(\?.*)?$/.exec(req.url);
const headers = { "Content-Type": "text/html" };
if (query === "?charset=csiso88598e") {
headers["Content-Type"] = "text/html;charset=csiso88598e";
}
res.writeHead(200, headers);
fs.createReadStream(fixturePath(fixture)).pipe(res);
}).then(s => {
server = s;