kopia lustrzana https://github.com/c9/core
handle nginx 404 errors
rodzic
af0a48f464
commit
42633db3b8
|
@ -186,10 +186,11 @@ define(function(require, exports, module) {
|
||||||
body += data;
|
body += data;
|
||||||
|
|
||||||
req.headers.accept= "text/html";
|
req.headers.accept= "text/html";
|
||||||
|
var statusCode = request.statusCode;
|
||||||
|
|
||||||
if (body.indexOf("EISDIR") !== -1) {
|
if (body.indexOf("EISDIR") !== -1) {
|
||||||
res.redirect(req.url + "/");
|
res.redirect(req.url + "/");
|
||||||
} else if (body.indexOf("ENOENT") !== -1) {
|
} else if (body.indexOf("ENOENT") !== -1 || statusCode == 404) {
|
||||||
next(new error.NotFound("File '" + path + "' could not be found!"));
|
next(new error.NotFound("File '" + path + "' could not be found!"));
|
||||||
} else {
|
} else {
|
||||||
delete req.session.ws[req.ws];
|
delete req.session.ws[req.ws];
|
||||||
|
@ -199,7 +200,6 @@ define(function(require, exports, module) {
|
||||||
json = JSON.parse(body);
|
json = JSON.parse(body);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
var statusCode = request.statusCode;
|
|
||||||
if (statusCode == 503) {
|
if (statusCode == 503) {
|
||||||
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
||||||
res.render(__dirname + "/views/progress.html.ejs", {
|
res.render(__dirname + "/views/progress.html.ejs", {
|
||||||
|
|
Ładowanie…
Reference in New Issue