mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-23 16:11:26 +00:00
Get full url for https and http separately.
This commit is contained in:
parent
6a2803b7c1
commit
6b89a0b9d7
@ -21,7 +21,7 @@ function userRequestHandler(req,userRes){
|
|||||||
|
|
||||||
var host = req.headers.host,
|
var host = req.headers.host,
|
||||||
protocol = (!!req.connection.encrypted && !/^http:/.test(req.url)) ? "https" : "http",
|
protocol = (!!req.connection.encrypted && !/^http:/.test(req.url)) ? "https" : "http",
|
||||||
fullUrl = protocol + '://' + host + req.url,
|
fullUrl = protocol === "http" ? req.url : (protocol + '://' + host + req.url),
|
||||||
urlPattern = url.parse(fullUrl),
|
urlPattern = url.parse(fullUrl),
|
||||||
path = urlPattern.path,
|
path = urlPattern.path,
|
||||||
resourceInfo,
|
resourceInfo,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user