more descriptive error message
This commit is contained in:
parent
2357319194
commit
983a6e2cd7
|
@ -443,16 +443,21 @@ module.exports.create = function (deps, conf, greenlockMiddleware) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
prom.then(function (handled) {
|
prom.then(function (handled) {
|
||||||
|
// XXX TODO SECURITY html escape
|
||||||
|
var host = (headers.host || '[no host header]').replace(/</, '<');
|
||||||
|
// TODO specify filepath of config file or database connection, etc
|
||||||
|
var msg = "Bad Gateway: Goldilocks accepted '" + host + "' but no module (neither static nor proxy) was designated to handle it. Check your config file.";
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
conn.end([
|
conn.end([
|
||||||
'HTTP/1.1 404 Not Found'
|
'HTTP/1.1 502 Bad Gateway'
|
||||||
, 'Date: ' + (new Date()).toUTCString()
|
, 'Date: ' + (new Date()).toUTCString()
|
||||||
, 'Content-Type: text/html'
|
, 'Content-Type: text/html'
|
||||||
, 'Content-Length: 9'
|
, 'Content-Length: ' + msg.length
|
||||||
, 'Connection: close'
|
, 'Connection: close'
|
||||||
, ''
|
, ''
|
||||||
, 'Not Found'
|
, msg
|
||||||
].join('\r\n'));
|
].join('\r\n'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue