[stable16] Correctly handle emtpy string in proxyuserpwd config#17511
[stable16] Correctly handle emtpy string in proxyuserpwd config#17511
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>
kesselb
left a comment
There was a problem hiding this comment.
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) { |
lib/private/Http/Client/Client.php
Outdated
|
|
||
| if ($proxyUserPwd !== null) { | ||
| if ($proxyUserPwd === '' || $proxyUserPwd === null) { | ||
| $proxyUri .= $proxyUserPwd . '@'; |
There was a problem hiding this comment.
| $proxyUri .= $proxyUserPwd . '@'; | |
| return $proxyHost; |
There was a problem hiding this comment.
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.
#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 = ''; |
|
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
kesselb
left a comment
There was a problem hiding this comment.
LGTM. Tests need some work.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
backport of #16721