From c0f392ae5cb1ab3ccb2be8a7325e0b1e0b168b59 Mon Sep 17 00:00:00 2001 From: jqliu Date: Tue, 19 Nov 2019 18:16:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81https=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util.js b/lib/util.js index ab3c8921d..16c94f81a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1119,6 +1119,7 @@ _.parseUrl = function(url, opt) { opt = opt || {}; url = Url.parse(url); var ssl = url.protocol === 'https:'; + opt.protocol = url.protocol; opt.host = opt.host || opt.hostname || ((ssl || url.protocol === 'http:') ? url.hostname : 'localhost'); opt.port = opt.port || (url.port || (ssl ? 443 : 80)); opt.path = opt.path || (url.pathname + (url.search ? url.search : '')); From d5b40dd7d278c38515ff9149030d811fbe2c3b6f Mon Sep 17 00:00:00 2001 From: jqliu Date: Tue, 19 Nov 2019 18:24:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttps=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 16c94f81a..72ac88ea2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1119,7 +1119,7 @@ _.parseUrl = function(url, opt) { opt = opt || {}; url = Url.parse(url); var ssl = url.protocol === 'https:'; - opt.protocol = url.protocol; + opt.protocol = opt.protocol || url.protocol; opt.host = opt.host || opt.hostname || ((ssl || url.protocol === 'http:') ? url.hostname : 'localhost'); opt.port = opt.port || (url.port || (ssl ? 443 : 80)); opt.path = opt.path || (url.pathname + (url.search ? url.search : ''));