Skip to content

Commit

Permalink
fix proxy bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarlotee authored Oct 17, 2016
1 parent 3f8b128 commit 5c4ca4c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ module.exports = function httpAdapter(config) {

if (proxy) {
options.host = proxy.host;
options.hostname = proxy.host;
options.headers.host = parsed.hostname;
options.port = proxy.port;
options.path = parsed.protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;
}
Expand Down

1 comment on commit 5c4ca4c

@scplay
Copy link

@scplay scplay commented on 5c4ca4c Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still wondering what kind of bug did this commit want to fix? I occasionally use a proxy to send a request which use an IP as URL but need a specific host field in the header. However when I check the host header on my proxy server, I found it has been changed to request IP address other than the host header I set before. I'm curious about what happened and finally found this commit.

Please sign in to comment.