Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-12 13:37:18 +0300
committerGitHub <noreply@github.com>2017-05-12 13:37:18 +0300
commit48a9a4bd81ce80f2b42f56aa3f09a0b1e5e0f46a (patch)
treeba6c8844bf671d529e431322f59fd9527fcf8664
parent98a7b346612c0327c871f4d10625d6aa388e55da (diff)
parentadad4281afb7cbff180770abec27fa73efa05e51 (diff)
Merge pull request #4825 from nextcloud/add-timeout-appstore
Add timeout for requests to appstore
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php4
-rw-r--r--tests/lib/App/AppStore/Fetcher/FetcherBase.php6
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index 02c55ac9d91..e559cf83e6d 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -85,7 +85,9 @@ abstract class Fetcher {
return [];
}
- $options = [];
+ $options = [
+ 'timeout' => 10,
+ ];
if ($ETag !== '') {
$options['headers'] = [
diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
index bd19141ea9f..2cfb34a0965 100644
--- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php
+++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
@@ -514,6 +514,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
+ 'timeout' => 10,
'headers' => [
'If-None-Match' => '"myETag"'
]
@@ -585,6 +586,7 @@ abstract class FetcherBase extends TestCase {
->with(
$this->equalTo($this->endpoint),
$this->equalTo([
+ 'timeout' => 10,
'headers' => [
'If-None-Match' => '"myETag"',
]
@@ -670,7 +672,9 @@ abstract class FetcherBase extends TestCase {
->method('get')
->with(
$this->equalTo($this->endpoint),
- $this->equalTo([])
+ $this->equalTo([
+ 'timeout' => 10,
+ ])
)
->willReturn($response);
$response->method('getStatusCode')