mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-05-13 15:09:25 +00:00
Upgrade http-proxy to 1.11.1
All xfwd and tests fails with this change, but that's because the tests themselves were incorrect (using port 80/443 instead of the ephemeral ports created for the tests).
This commit is contained in:
@@ -77,11 +77,11 @@ function proxyRequest(req, res, proxy) {
|
||||
var location = req.corsAnywhereRequestState.location;
|
||||
|
||||
req.url = location.path;
|
||||
// Let the "Host" header be the host part of the path (including port, if specified).
|
||||
req.headers.host = location.host;
|
||||
|
||||
// Start proxying the request
|
||||
proxy.web(req, res, {
|
||||
changeOrigin: true,
|
||||
prependPath: false,
|
||||
target: location
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
],
|
||||
"main": "./lib/cors-anywhere.js",
|
||||
"dependencies": {
|
||||
"http-proxy": "1.3.0"
|
||||
"http-proxy": "1.11.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~2.2.4",
|
||||
|
||||
@@ -390,8 +390,8 @@ describe('removeHeaders', function() {
|
||||
.set('cookie3', 'c')
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expectJSON({
|
||||
host: 'example.com',
|
||||
cookie3: 'c',
|
||||
host: 'example.com',
|
||||
}, done);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user