1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-28 14:58:15 +09:00

[Server] Fix bug

Reject request that without 'Host' header
This commit is contained in:
syuilo 2017-01-07 23:57:45 +09:00
parent ed18520bf4
commit 8b273e215f

View File

@ -14,6 +14,15 @@ import vhost = require('vhost');
const app = express();
app.disable('x-powered-by');
// Reject request that without 'Host' header
app.use((req, res, next) => {
if (!req.headers.host) {
res.sendStatus(400);
} else {
next();
}
});
/**
* Register modules
*/