diff options
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/lib/DiscoveryManager.php | 4 | ||||
-rw-r--r-- | apps/federatedfilesharing/lib/Notifications.php | 4 | ||||
-rw-r--r-- | apps/federatedfilesharing/tests/DiscoveryManagerTest.php | 25 |
3 files changed, 24 insertions, 9 deletions
diff --git a/apps/federatedfilesharing/lib/DiscoveryManager.php b/apps/federatedfilesharing/lib/DiscoveryManager.php index bf8dfeb31dc..25af0a40fd5 100644 --- a/apps/federatedfilesharing/lib/DiscoveryManager.php +++ b/apps/federatedfilesharing/lib/DiscoveryManager.php @@ -85,8 +85,8 @@ class DiscoveryManager { // Read the data from the response body try { $response = $this->client->get($remote . '/ocs-provider/', [ - 'timeout' => 3, - 'connect_timeout' => 3, + 'timeout' => 10, + 'connect_timeout' => 10, ]); if($response->getStatusCode() === 200) { $decodedService = json_decode($response->getBody(), true); diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index 575521d564d..fefa959ba37 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -288,8 +288,8 @@ class Notifications { try { $response = $client->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ 'body' => $fields, - 'timeout' => 3, - 'connect_timeout' => 3, + 'timeout' => 10, + 'connect_timeout' => 10, ]); $result['result'] = $response->getBody(); $result['success'] = true; diff --git a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php index 73f79b2c169..a9c324f0244 100644 --- a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php +++ b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php @@ -77,7 +77,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $this->cache ->expects($this->at(0)) @@ -111,7 +114,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/public.php/MyCustomEndpoint/'; @@ -131,7 +137,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/public.php/webdav'; @@ -151,7 +160,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $expectedResult = '/ocs/v2.php/cloud/MyCustomShareEndpoint'; @@ -171,7 +183,10 @@ class DiscoveryManagerTest extends \Test\TestCase { $this->client ->expects($this->once()) ->method('get') - ->with('https://myhost.com/ocs-provider/', []) + ->with('https://myhost.com/ocs-provider/', [ + 'timeout' => 10, + 'connect_timeout' => 10, + ]) ->willReturn($response); $this->cache ->expects($this->at(0)) |