From 72943c99a4942bceaef750db6ea4eb7d582585d5 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 11 May 2017 17:48:53 -0500 Subject: [PATCH 1/2] Add timeout for requests to appstore Signed-off-by: Morris Jobke --- lib/private/App/AppStore/Fetcher/Fetcher.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index ccf5162ed8..3ab73d6b7f 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -78,7 +78,9 @@ abstract class Fetcher { return []; } - $options = []; + $options = [ + 'timeout' => 10, + ]; if ($ETag !== '') { $options['headers'] = [ From adad4281afb7cbff180770abec27fa73efa05e51 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 May 2017 09:58:18 +0200 Subject: [PATCH 2/2] Fix failed assertions Signed-off-by: Joas Schilling --- tests/lib/App/AppStore/Fetcher/FetcherBase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php index 3d89ae942a..102c119e9e 100644 --- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php +++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php @@ -510,6 +510,7 @@ abstract class FetcherBase extends TestCase { ->with( $this->equalTo($this->endpoint), $this->equalTo([ + 'timeout' => 10, 'headers' => [ 'If-None-Match' => '"myETag"' ] @@ -581,6 +582,7 @@ abstract class FetcherBase extends TestCase { ->with( $this->equalTo($this->endpoint), $this->equalTo([ + 'timeout' => 10, 'headers' => [ 'If-None-Match' => '"myETag"', ] @@ -666,7 +668,9 @@ abstract class FetcherBase extends TestCase { ->method('get') ->with( $this->equalTo($this->endpoint), - $this->equalTo([]) + $this->equalTo([ + 'timeout' => 10, + ]) ) ->willReturn($response); $response->method('getStatusCode')