diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2019-02-19 17:32:01 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2019-02-19 17:32:01 +0100 |
commit | 5ad86170c16c03c1713ef7eadcf536baac09a44f (patch) | |
tree | 2f02119015d5a4a738ec9879807196e58e16c4b8 /lib/private/Federation | |
parent | e7f0e8ba03363f37631ded3099d4e2bf0df5d5f6 (diff) | |
download | nextcloud-server-5ad86170c16c03c1713ef7eadcf536baac09a44f.tar.gz nextcloud-server-5ad86170c16c03c1713ef7eadcf536baac09a44f.zip |
According to the OCM specification the body needs to be JSON encoded
see: https://github.com/GEANT/OCM-API/pull/37
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Federation')
-rw-r--r-- | lib/private/Federation/CloudFederationProviderManager.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php index 94b2f052747..c2944f410b3 100644 --- a/lib/private/Federation/CloudFederationProviderManager.php +++ b/lib/private/Federation/CloudFederationProviderManager.php @@ -134,7 +134,6 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager public function sendShare(ICloudFederationShare $share) { $cloudID = $this->cloudIdManager->resolveCloudId($share->getShareWith()); $ocmEndPoint = $this->getOCMEndPoint($cloudID->getRemote()); - if (empty($ocmEndPoint)) { return false; } @@ -142,7 +141,8 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager $client = $this->httpClientService->newClient(); try { $response = $client->post($ocmEndPoint . '/shares', [ - 'body' => $share->getShare(), + 'body' => json_encode($share->getShare()), + 'headers' => ['content-type' => 'application/json'], 'timeout' => 10, 'connect_timeout' => 10, ]); @@ -181,7 +181,8 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager $client = $this->httpClientService->newClient(); try { $response = $client->post($ocmEndPoint . '/notifications', [ - 'body' => $notification->getMessage(), + 'body' => json_encode($notification->getMessage()), + 'headers' => ['content-type' => 'application/json'], 'timeout' => 10, 'connect_timeout' => 10, ]); |