Skip to content
Snippets Groups Projects
Unverified Commit fd1d8536 authored by Daniel Kesselberg's avatar Daniel Kesselberg
Browse files

Refactor getProxyUri


Get proxyuserpwd only if proxy not empty.

Signed-off-by: default avatarDaniel Kesselberg <mail@danielkesselberg.de>
parent 2708d264
No related branches found
No related tags found
No related merge requests found
...@@ -96,21 +96,18 @@ class Client implements IClient { ...@@ -96,21 +96,18 @@ class Client implements IClient {
*/ */
private function getProxyUri(): ?string { private function getProxyUri(): ?string {
$proxyHost = $this->config->getSystemValue('proxy', null); $proxyHost = $this->config->getSystemValue('proxy', null);
$proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null);
if ($proxyHost === null && $proxyUserPwd === null) { if ($proxyHost === null) {
return null; return null;
} }
$proxyUri = ''; $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null);
if ($proxyUserPwd !== null) {
$proxyUri .= $proxyUserPwd . '@'; if ($proxyUserPwd === null) {
} return $proxyHost;
if ($proxyHost !== null) {
$proxyUri .= $proxyHost;
} }
return $proxyUri; return $proxyUserPwd . '@' . $proxyHost;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment