diff options
author | Scott Shambarger <devel@shambarger.net> | 2019-08-02 15:18:01 -0700 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-08-11 21:07:30 +0200 |
commit | edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769 (patch) | |
tree | b1adc90ab2e142a6e0fd9b7643450bef33dc9d1a /tests | |
parent | 1d72073e349bf6926a13c085495c44fce2406e61 (diff) | |
download | nextcloud-server-edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769.tar.gz nextcloud-server-edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769.zip |
Correctly handle emtpy string in proxyuserpwd config
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Http/Client/ClientTest.php | 14 |
1 files changed, 12 insertions, 2 deletions
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')); } |