-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update host.ProxyHandler to compatiable with different hosts in target url and request host #1703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @tuhao1020, how are you?
I think we must not introduce changes to that function, as it may be used by many applications and it was not updated for the past versions. I think it's better to introduce a new function for that e.g. ProxyHandlerRemote
, please do it and don't forget to use gofmt
:P
@kataras I have added ProxyHandlerRemote and NewProxyRemote, and code has formatted :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @tuhao1020 (although there is space for improvements there, e.g. remove the code duplication on the ProxyHandlerRemote, the 95% of the code is identical to the existing ProxyHandler one, but I will fix it later on)
Lines 40 to 55 in 6c823e4
Line 43: req.Host = target.Host Lines 70 to 72 in 6c823e4
req.Host = target.Host should be placed after above code.
|
Oh you are totally right, merging the 2nd one now @tuhao1020 . |
#1702