mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #14293 from nextcloud/fix-ocm-implementation
According to the OCM specification the body needs to be JSON encoded
This commit is contained in:
commit
10ae7af87f
1 changed files with 4 additions and 3 deletions
|
|
@ -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,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue