-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[stable16] Correctly handle emtpy string in proxyuserpwd config #17511
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
Conversation
As documented, the default value for config value proxyuserpwd is ''. However, that value results in the error: "cURL error 5: Unsupported proxy syntax in '@'". This patch handles the values of '' and null (the default in the code) the same for config values proxyuserpwd and proxy. Signed-off-by: Scott Shambarger <devel@shambarger.net>
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.
Fine by me
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.
Please change the last return to return $proxyUserPwd . '@' . $proxyHost;. I cannot suggest a change for this line.
lib/private/Http/Client/Client.php
Outdated
| if ($proxyUserPwd === '' || $proxyUserPwd === null) { | ||
| $proxyUri .= $proxyUserPwd . '@'; | ||
| } | ||
| if ($proxyHost !== null) { |
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.
Dead code
lib/private/Http/Client/Client.php
Outdated
|
|
||
| if ($proxyUserPwd !== null) { | ||
| if ($proxyUserPwd === '' || $proxyUserPwd === null) { | ||
| $proxyUri .= $proxyUserPwd . '@'; |
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.
| $proxyUri .= $proxyUserPwd . '@'; | |
| return $proxyHost; |
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.
lets keep the backport as identical as we can to the original. Then we can do what you suggest in a PR against master ;)
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.
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.
#14363 is not totally needed, to fix the issue that proxy is set to '@' when the documented default values are used in config.php instead of null.
lib/private/Http/Client/Client.php
Outdated
| } | ||
|
|
||
| $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', ''); | ||
| $proxyUri = ''; |
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.
Dead code
|
Hmm. Tricky to backport because fd1d853 is not backported. |
|
@kesselb good catch. De-facto it the other commit is picked up half-way through merge conflict resolution, but some pieces are too much indeed. I ironed it out. |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
6067e2e to
0f5cc52
Compare
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. Tests need some work.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
backport of #16721