diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-02-24 19:24:13 +0100 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-04-16 21:13:29 +0200 |
commit | fd1d85365cb1368fa70263fe3ae3b8e59ab56615 (patch) | |
tree | 85d81cdd749a0c17ead8b0d0bcb5a6ede128f609 /lib/private/Http | |
parent | 2708d264071fc33d81b53a8f33de2074e4210a76 (diff) | |
download | nextcloud-server-fd1d85365cb1368fa70263fe3ae3b8e59ab56615.tar.gz nextcloud-server-fd1d85365cb1368fa70263fe3ae3b8e59ab56615.zip |
Refactor getProxyUri
Get proxyuserpwd only if proxy not empty.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private/Http')
-rw-r--r-- | lib/private/Http/Client/Client.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index baa358f2fea..ad51feca0be 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -96,21 +96,18 @@ class Client implements IClient { */ private function getProxyUri(): ?string { $proxyHost = $this->config->getSystemValue('proxy', null); - $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); - if ($proxyHost === null && $proxyUserPwd === null) { + if ($proxyHost === null) { return null; } - $proxyUri = ''; - if ($proxyUserPwd !== null) { - $proxyUri .= $proxyUserPwd . '@'; - } - if ($proxyHost !== null) { - $proxyUri .= $proxyHost; + $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); + + if ($proxyUserPwd === null) { + return $proxyHost; } - return $proxyUri; + return $proxyUserPwd . '@' . $proxyHost; } /** |