Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
response.writeHead(500, "Server Error");
}
catch (headerError) {
// We can't set a header once the headers have already
// been sent - catch failed attempt to overwrite the
// response code.
}
finally {
response.end("500 Server Error");
}
});
}
let specialFiles = Object.create(null);
const pathUtils = require("./pathUtils");
specialFiles["loader.js"] = require.resolve("./loader.js");
specialFiles["jasmine-core.js"] = path.join(pathUtils.dirOfNodeModule("jasmine-core"), "jasmine-core/jasmine.js");
specialFiles["jasmine-boot.js"] = require.resolve("./jasmine-boot.js");
let livereloadResolver;
let livereloadPromise;
function respondSpecial(response, name) {
let c = specialFiles[name];
if (c == null) {
console.log(`Respond Special not found ${name}`);
response.statusCode = 404;
response.end("Not found");
return;
}
if (typeof c === "string") {
c = fs.readFileSync(c);
specialFiles[name] = c;
}
response.end(c);
try {
response.setHeader("Content-Length", "0");
response.setHeader("Cache-Control", "max-age=0");
response.writeHead(500, "Server Error");
}
catch (headerError) {
}
finally {
response.end("500 Server Error");
}
});
}
let specialFiles = Object.create(null);
const pathUtils = require('./pathUtils');
specialFiles["loader.js"] = require.resolve("./loader.js");
specialFiles["jasmine-core.js"] = path.join(pathUtils.dirOfNodeModule("jasmine-core"), 'jasmine-core/jasmine.js');
specialFiles["jasmine-boot.js"] = require.resolve("./jasmine-boot.js");
let livereloadResolver;
let livereloadPromise;
function respondSpecial(response, name) {
let c = specialFiles[name];
if (c == null) {
console.log(`Respond Special not found ${name}`);
response.statusCode = 404;
response.end("Not found");
return;
}
if (typeof c === "string") {
c = fs.readFileSync(c);
specialFiles[name] = c;
}
response.end(c);