FIx for status-error crashing on routingFunction in app.js

This commit is contained in:
Kasper Rynning-Tønnesen
2019-04-06 15:11:06 +02:00
parent 80db2f7068
commit 1e7153b995

View File

@@ -138,6 +138,9 @@ function routingFunction(req, res, next) {
client(req, res, next); client(req, res, next);
} }
} catch(e) { } catch(e) {
res.status(500); console.log("Bad request for " + req.headers.host + req.url, e);
res.statusCode = 500;
res.write('Bad request'); //write a response to the client
res.end(); //end the response
} }
} }