diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-12 12:37:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-12 12:37:18 +0200 |
commit | 48a9a4bd81ce80f2b42f56aa3f09a0b1e5e0f46a (patch) | |
tree | ba6c8844bf671d529e431322f59fd9527fcf8664 | |
parent | 98a7b346612c0327c871f4d10625d6aa388e55da (diff) | |
parent | adad4281afb7cbff180770abec27fa73efa05e51 (diff) | |
download | nextcloud-server-48a9a4bd81ce80f2b42f56aa3f09a0b1e5e0f46a.tar.gz nextcloud-server-48a9a4bd81ce80f2b42f56aa3f09a0b1e5e0f46a.zip |
Merge pull request #4825 from nextcloud/add-timeout-appstore
Add timeout for requests to appstore
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 4 | ||||
-rw-r--r-- | tests/lib/App/AppStore/Fetcher/FetcherBase.php | 6 |
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') |