summaryrefslogtreecommitdiffstats
path: root/lib/private/Share/Share.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 16:30:41 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-13 21:54:56 +0100
commit7785c3752fbfef792cd33dc5da2ee63e8263b9fa (patch)
tree66b68c5f9ce30ec87c51aebc7d9ffe0c14b30d2f /lib/private/Share/Share.php
parentede723f1b19c4c1afb7627af85c1e2f8d8a31386 (diff)
downloadnextcloud-server-7785c3752fbfef792cd33dc5da2ee63e8263b9fa.tar.gz
nextcloud-server-7785c3752fbfef792cd33dc5da2ee63e8263b9fa.zip
Remove deprecated HTTPHelper
* Remove the HTTP Helper * Remove from Server Containter * Removed legacy share tests that use it Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Share/Share.php')
-rw-r--r--lib/private/Share/Share.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index e6056679c1c..4514cdbae1b 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -1991,7 +1991,22 @@ class Share extends Constants {
while ($result['success'] === false && $try < 2) {
$federationEndpoints = $discoveryService->discover($protocol . $remoteDomain, 'FEDERATED_SHARING');
$endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
- $result = \OC::$server->getHTTPHelper()->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, $fields);
+ $client = \OC::$server->getHTTPClientService()->newClient();
+
+ try {
+ $response = $client->post(
+ $protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT,
+ [
+ 'body' => $fields,
+ 'connect_timeout' => 10,
+ ]
+ );
+
+ $result = ['success' => true, 'result' => $response->getBody()];
+ } catch (\Exception $e) {
+ $result = ['success' => false, 'result' => $e->getMessage()];
+ }
+
$try++;
$protocol = 'http://';
}