forked from svrjs/svrjs
Adapted redirectes middleware function to new SVR.JS API.
This commit is contained in:
parent
53024dfdab
commit
cbd3ab0cd0
1 changed files with 4 additions and 4 deletions
|
@ -6,14 +6,14 @@ module.exports = (req, res, logFacilities, config, next) => {
|
||||||
if (config.secure && !fromMain && !config.disableNonEncryptedServer && !config.disableToHTTPSRedirect) {
|
if (config.secure && !fromMain && !config.disableNonEncryptedServer && !config.disableToHTTPSRedirect) {
|
||||||
var hostx = req.headers.host;
|
var hostx = req.headers.host;
|
||||||
if (hostx === undefined) {
|
if (hostx === undefined) {
|
||||||
serverconsole.errmessage("Host header is missing.");
|
logFacilities.errmessage("Host header is missing.");
|
||||||
callServerError(400);
|
res.error(400);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.isProxy) {
|
if (req.isProxy) {
|
||||||
callServerError(501);
|
res.error(501);
|
||||||
serverconsole.errmessage("This server will never be a proxy.");
|
logFacilities.errmessage("This server will never be a proxy.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue