forked from svrjs/svrjs
Optimize HTTP/1.x compatibility header setting
This commit is contained in:
parent
6c8873ce3f
commit
7b0038754e
1 changed files with 3 additions and 2 deletions
5
svr.js
5
svr.js
|
@ -2946,8 +2946,9 @@ if (!cluster.isPrimary) {
|
|||
|
||||
// Set HTTP/1.x headers
|
||||
if (!req.headers.host) req.headers.host = req.headers[":authority"];
|
||||
(req.headers[":path"] == undefined ? (function () {})() : req.url = req.headers[":path"]);
|
||||
req.protocol = req.headers[":scheme"];
|
||||
if (!req.url) req.url = req.headers[":path"];
|
||||
if (!req.protocol) req.protocol = req.headers[":scheme"];
|
||||
if (!req.method) req.method = req.headers[":method"];
|
||||
if (req.headers[":path"] == undefined || req.headers[":method"] == undefined) {
|
||||
var cheaders = getCustomHeaders();
|
||||
cheaders["Content-Type"] = "text/html; charset=utf-8";
|
||||
|
|
Reference in a new issue