kopia lustrzana https://github.com/c9/core
Merge branch 'fix-m8-security-issue' into fix-m9-security-issue
commit
88d305174c
|
@ -19,12 +19,13 @@ module.exports = function setup(mount, vfs, mountOptions) {
|
|||
if (code) res.statusCode = code;
|
||||
else if (typeof err.code == "number") res.statusCode = err.code;
|
||||
else if (err.code === "EBADREQUEST") res.statusCode = 400;
|
||||
else if (err.code === "EACCESS") res.statusCode = 403;
|
||||
else if (err.code === "EACCES") res.statusCode = 403;
|
||||
else if (err.code === "ENOENT") res.statusCode = 404;
|
||||
else if (err.code === "ENOTREADY") res.statusCode = 503;
|
||||
else if (err.code === "EISDIR") res.statusCode = 503;
|
||||
else res.statusCode = 500;
|
||||
var message = (err.stack || err) + "\n";
|
||||
var message = (err.message || err.toString()) + "\n";
|
||||
res.setHeader("Content-Type", "text/plain");
|
||||
res.setHeader("Content-Length", Buffer.byteLength(message));
|
||||
res.end(message);
|
||||
|
|
Ładowanie…
Reference in New Issue