summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-05-14 12:37:10 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 11:29:27 +0200
commitaf178ef19a8ead9943efe9b13de8fd3ec96bf447 (patch)
tree1582868036585e7592e01f29ac0957a40e4ca755 /lib
parentdb428ea5471a5be5517911b3bf2f3a6d3f86e297 (diff)
downloadnextcloud-server-af178ef19a8ead9943efe9b13de8fd3ec96bf447.tar.gz
nextcloud-server-af178ef19a8ead9943efe9b13de8fd3ec96bf447.zip
check API Version
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Federation/CloudFederationProviderManager.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php
index c302659fb69..b0f5c58f51d 100644
--- a/lib/private/Federation/CloudFederationProviderManager.php
+++ b/lib/private/Federation/CloudFederationProviderManager.php
@@ -57,6 +57,8 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
/** @var ILogger */
private $logger;
+ private $supportedAPIVersion = '2.0-draft';
+
/**
* CloudFederationProviderManager constructor.
*
@@ -216,7 +218,9 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
$result = $response->getBody();
$result = json_decode($result, true);
- if (isset($result['end-point'])) {
+ $supportedVersion = isset($result['api-version']) && $result['api-version'] === $this->supportedAPIVersion;
+
+ if (isset($result['end-point']) && $supportedVersion) {
return $result['end-point'];
}