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>
pull/14293/head
Bjoern Schiessle 5 years ago
parent e7f0e8ba03
commit 5ad86170c1
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6

@ -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…
Cancel
Save