Set etag for capabilities endpoint
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
b219eadb8f
commit
df669a2936
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue