summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Http/Client/Client.php8
-rw-r--r--tests/lib/Http/Client/ClientTest.php14
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php
index ad51feca0be..993b83917fd 100644
--- a/lib/private/Http/Client/Client.php
+++ b/lib/private/Http/Client/Client.php
@@ -95,15 +95,15 @@ class Client implements IClient {
* @return string|null
*/
private function getProxyUri(): ?string {
- $proxyHost = $this->config->getSystemValue('proxy', null);
+ $proxyHost = $this->config->getSystemValue('proxy', '');
- if ($proxyHost === null) {
+ if ($proxyHost === '' || $proxyHost === null) {
return null;
}
- $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null);
+ $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', '');
- if ($proxyUserPwd === null) {
+ if ($proxyUserPwd === '' || $proxyUserPwd === null) {
return $proxyHost;
}
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php
index f43958ab865..7a25acd9a50 100644
--- a/tests/lib/Http/Client/ClientTest.php
+++ b/tests/lib/Http/Client/ClientTest.php
@@ -70,12 +70,22 @@ class ClientTest extends \Test\TestCase {
$this->config
->expects($this->at(0))
->method('getSystemValue')
- ->with('proxy', null)
+ ->with(
+ $this->equalTo('proxy'),
+ $this->callback(function ($input) {
+ return $input === '';
+ })
+ )
->willReturn('foo');
$this->config
->expects($this->at(1))
->method('getSystemValue')
- ->with('proxyuserpwd', null)
+ ->with(
+ $this->equalTo('proxyuserpwd'),
+ $this->callback(function ($input) {
+ return $input === '';
+ })
+ )
->willReturn('username:password');
$this->assertSame('username:password@foo', self::invokePrivate($this->client, 'getProxyUri'));
}