Set etag for capabilities endpoint

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-04-29 15:16:53 +02:00
parent b219eadb8f
commit df669a2936
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
2 changed files with 5 additions and 1 deletions

View File

@ -108,7 +108,9 @@ class OCSController extends \OCP\AppFramework\OCSController {
$result['capabilities'] = $this->capabilitiesManager->getCapabilities(true);
}
return new DataResponse($result);
$response = new DataResponse($result);
$response->setETag(md5(json_encode($result)));
return $response;
}
/**

View File

@ -113,6 +113,7 @@ class OCSControllerTest extends TestCase {
$result['capabilities'] = $capabilities;
$expected = new DataResponse($result);
$expected->setETag(md5(json_encode($result)));
$this->assertEquals($expected, $this->controller->getCapabilities());
}
@ -146,6 +147,7 @@ class OCSControllerTest extends TestCase {
$result['capabilities'] = $capabilities;
$expected = new DataResponse($result);
$expected->setETag(md5(json_encode($result)));
$this->assertEquals($expected, $this->controller->getCapabilities());
}