forked from svrjs/svrjs
Fixed host name rewriting
This commit is contained in:
parent
949e799d45
commit
7be1c2a73b
1 changed files with 1 additions and 1 deletions
2
svr.js
2
svr.js
|
@ -2968,7 +2968,7 @@ if (!cluster.isPrimary) {
|
|||
var oldHostHeader = req.headers.host;
|
||||
if (typeof req.headers.host == "string") {
|
||||
req.headers.host = req.headers.host.toLowerCase();
|
||||
if(!req.headers.host.match(/^\.+$/)) req.headers.host = req.headers.host.replace(/^\.$/g,"");
|
||||
if(!req.headers.host.match(/^\.+$/)) req.headers.host = req.headers.host.replace(/\.$/g,"");
|
||||
}
|
||||
|
||||
if (!isProxy) serverconsole.reqmessage("Client " + ((!reqip || reqip == "") ? "[unknown client]" : (reqip + ((reqport && reqport !== 0) && reqport != "" ? ":" + reqport : ""))) + " wants " + (req.method == "GET" ? "content in " : (req.method == "POST" ? "to post content in " : (req.method == "PUT" ? "to add content in " : (req.method == "DELETE" ? "to delete content in " : (req.method == "PATCH" ? "to patch content in " : "to access content using " + req.method + " method in "))))) + (req.headers.host == undefined ? "" : req.headers.host) + req.url);
|
||||
|
|
Reference in a new issue