diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-06-15 16:30:24 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-22 10:29:40 +0200 |
commit | 3e763ac81e895d2b4af18af2bcd7a31e25da4cf6 (patch) | |
tree | 12539e73e95bb8938ba63beedd078933a132592e /apps/files_sharing/ajax | |
parent | b85bcccc09746137dd6fed78629b5bce45cebe01 (diff) | |
download | nextcloud-server-3e763ac81e895d2b4af18af2bcd7a31e25da4cf6.tar.gz nextcloud-server-3e763ac81e895d2b4af18af2bcd7a31e25da4cf6.zip |
Add timeouts to make the UI usable again when a remote share is unreachable
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r-- | apps/files_sharing/ajax/external.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index 5cf86087f94..6a0a4dfc06b 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -77,7 +77,10 @@ $externalManager = new \OCA\Files_Sharing\External\Manager( // check for ssl cert if (substr($remote, 0, 5) === 'https') { try { - \OC::$server->getHTTPClientService()->newClient()->get($remote)->getBody(); + \OC::$server->getHTTPClientService()->newClient()->get($remote, [ + 'timeout' => 3, + 'connect_timeout' => 3, + ])->getBody(); } catch (\Exception $e) { \OCP\JSON::error(array('data' => array('message' => $l->t('Invalid or untrusted SSL certificate')))); exit; |