Merge pull request #4825 from nextcloud/add-timeout-appstore

Add timeout for requests to appstore
This commit is contained in:
Lukas Reschke 2017-05-12 12:37:18 +02:00 committed by GitHub
commit 48a9a4bd81
2 changed files with 8 additions and 2 deletions

View File

@ -85,7 +85,9 @@ abstract class Fetcher {
return []; return [];
} }
$options = []; $options = [
'timeout' => 10,
];
if ($ETag !== '') { if ($ETag !== '') {
$options['headers'] = [ $options['headers'] = [

View File

@ -514,6 +514,7 @@ abstract class FetcherBase extends TestCase {
->with( ->with(
$this->equalTo($this->endpoint), $this->equalTo($this->endpoint),
$this->equalTo([ $this->equalTo([
'timeout' => 10,
'headers' => [ 'headers' => [
'If-None-Match' => '"myETag"' 'If-None-Match' => '"myETag"'
] ]
@ -585,6 +586,7 @@ abstract class FetcherBase extends TestCase {
->with( ->with(
$this->equalTo($this->endpoint), $this->equalTo($this->endpoint),
$this->equalTo([ $this->equalTo([
'timeout' => 10,
'headers' => [ 'headers' => [
'If-None-Match' => '"myETag"', 'If-None-Match' => '"myETag"',
] ]
@ -670,7 +672,9 @@ abstract class FetcherBase extends TestCase {
->method('get') ->method('get')
->with( ->with(
$this->equalTo($this->endpoint), $this->equalTo($this->endpoint),
$this->equalTo([]) $this->equalTo([
'timeout' => 10,
])
) )
->willReturn($response); ->willReturn($response);
$response->method('getStatusCode') $response->method('getStatusCode')