Skip to content

Commit 22f3c73

Browse files
committed
Add changeOrigin option
Add changeOrigin option that changes host in request headers
1 parent f70015f commit 22f3c73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/http-proxy/common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
7474

7575
outgoing.path = common.urlJoin(targetPath, outgoingPath);
7676

77+
if (options.changeOrigin) {
78+
outgoing.headers.host = outgoing.host;
79+
}
80+
7781
return outgoing;
7882
};
7983

0 commit comments

Comments
 (0)