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
Fix tunneling after redirection from https #1881
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,8 @@ Redirect.prototype.onResponse = function (response) { | |
// changing ports or protocols). This matches the behavior of curl: | ||
// https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 | ||
request.removeHeader('authorization') | ||
delete request.options.auth | ||
delete request.options.oauth | ||
} | ||
} | ||
} | ||
|
@@ -145,7 +147,7 @@ Redirect.prototype.onResponse = function (response) { | |
|
||
request.emit('redirect') | ||
|
||
request.init() | ||
request.init(request.options) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes me nervous. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that re-calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @falms it might be better, but given the existing code base it's better to keep things consistent instead of adding even more noise. |
||
|
||
return true | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,7 @@ function Request (options) { | |
self._redirect = new Redirect(self) | ||
self._tunnel = new Tunnel(self) | ||
self.init(options) | ||
self.options = options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has a bit of a bad code smell because we already set lots of properties on |
||
} | ||
|
||
util.inherits(Request, stream.Stream) | ||
|
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.
This does not appear related to the tunneling changes, can you explain?
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.
You are right.. This is related to
init
changes in redirect.js, not tunneling.