mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-05-13 15:09:25 +00:00
Remove requiresPort dependency
location.host is directly parsed from the full URL, so the "concatenate host and port" branch was never taken.
This commit is contained in:
@@ -8,7 +8,6 @@ var net = require('net');
|
||||
var url = require('url');
|
||||
var regexp_tld = require('./regexp-top-level-domain');
|
||||
var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
|
||||
var requiresPort = require('requires-port');
|
||||
|
||||
var help_file = __dirname + '/help.txt';
|
||||
var help_text;
|
||||
@@ -83,9 +82,7 @@ function proxyRequest(req, res, proxy) {
|
||||
prependPath: false,
|
||||
target: location,
|
||||
headers: {
|
||||
host: requiresPort(location.port, location.protocol) && !/:\d*$/.test(location.host) ?
|
||||
location.host + ':' + location.port :
|
||||
location.host,
|
||||
host: location.host,
|
||||
},
|
||||
};
|
||||
var proxyThroughUrl = req.corsAnywhereRequestState.getProxyForUrl(location.href);
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"main": "./lib/cors-anywhere.js",
|
||||
"dependencies": {
|
||||
"http-proxy": "1.11.1",
|
||||
"proxy-from-env": "0.0.1",
|
||||
"requires-port": "1.0.0"
|
||||
"proxy-from-env": "0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.6",
|
||||
|
||||
Reference in New Issue
Block a user