summaryrefslogtreecommitdiffstats
path: root/lib/private/httphelper.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-05-26 11:22:50 +0200
committerLukas Reschke <lukas@owncloud.com>2015-05-26 11:22:50 +0200
commitdff361dc5ce4501396974785b2be22287b15b895 (patch)
treee21e0c71cd3ac56cdfd95cb2bbbb67ba23985620 /lib/private/httphelper.php
parentb82d902e184960877110bc45124ed2399f779cac (diff)
downloadnextcloud-server-dff361dc5ce4501396974785b2be22287b15b895.tar.gz
nextcloud-server-dff361dc5ce4501396974785b2be22287b15b895.zip
Add connection timeout to default POST options
Fixes https://github.com/owncloud/core/issues/16560
Diffstat (limited to 'lib/private/httphelper.php')
-rw-r--r--lib/private/httphelper.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/httphelper.php b/lib/private/httphelper.php
index f7984a72ebb..9d9edb6a351 100644
--- a/lib/private/httphelper.php
+++ b/lib/private/httphelper.php
@@ -102,7 +102,13 @@ class HTTPHelper {
$client = $this->clientService->newClient();
try {
- $response = $client->post($url, ['body' => $fields]);
+ $response = $client->post(
+ $url,
+ [
+ 'body' => $fields,
+ 'connect_timeout' => 10,
+ ]
+ );
} catch (\Exception $e) {
return ['success' => false, 'result' => $e->getMessage()];
}