mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 14:05:12 +00:00
[Server] Fix bug
Reject request that without 'Host' header
This commit is contained in:
parent
ed18520bf4
commit
8b273e215f
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue