mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
changeOrigin option: set the host header to the proxy destination
This commit is contained in:
parent
b4d41c3628
commit
f27d26f451
@ -194,6 +194,8 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
|
||||
outgoing.method = req.method;
|
||||
outgoing.path = req.url;
|
||||
outgoing.headers = req.headers;
|
||||
|
||||
if(this.changeOrigin)
|
||||
outgoing.headers.host = this.target.host + (this.target.port == 80 ? '' : ':' + this.target.port)
|
||||
//
|
||||
// Open new HTTP request to internal resource with will act
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user