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) {
|
||||
// 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) {
|
||||
conn.end([
|
||||
'HTTP/1.1 404 Not Found'
|
||||
'HTTP/1.1 502 Bad Gateway'
|
||||
, 'Date: ' + (new Date()).toUTCString()
|
||||
, 'Content-Type: text/html'
|
||||
, 'Content-Length: 9'
|
||||
, 'Content-Length: ' + msg.length
|
||||
, 'Connection: close'
|
||||
, ''
|
||||
, 'Not Found'
|
||||
, msg
|
||||
].join('\r\n'));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue