[Server] Fix bug
Reject request that without 'Host' header
This commit is contained in:
		@@ -14,6 +14,15 @@ import vhost = require('vhost');
 | 
				
			|||||||
const app = express();
 | 
					const app = express();
 | 
				
			||||||
app.disable('x-powered-by');
 | 
					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
 | 
					 * Register modules
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user