mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-23 16:01:26 +00:00
parent
7c2a161c0a
commit
1e8b61ac77
@ -223,7 +223,15 @@ function getUserReqHandler(userRule, recorder) {
|
|||||||
|
|
||||||
const host = req.headers.host;
|
const host = req.headers.host;
|
||||||
const protocol = (!!req.connection.encrypted && !(/^http:/).test(req.url)) ? 'https' : 'http';
|
const protocol = (!!req.connection.encrypted && !(/^http:/).test(req.url)) ? 'https' : 'http';
|
||||||
const fullUrl = protocol === 'http' ? req.url : (protocol + '://' + host + req.url);
|
|
||||||
|
// try find fullurl https://github.com/alibaba/anyproxy/issues/419
|
||||||
|
let fullUrl = protocol + '://' + host + req.url;
|
||||||
|
if (protocol === 'http') {
|
||||||
|
const reqUrlPattern = url.parse(req.url);
|
||||||
|
if (reqUrlPattern.host && reqUrlPattern.protocol) {
|
||||||
|
fullUrl = req.url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const urlPattern = url.parse(fullUrl);
|
const urlPattern = url.parse(fullUrl);
|
||||||
const path = urlPattern.path;
|
const path = urlPattern.path;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user