Commit b2734bbd authored by alexpott's avatar alexpott

Issue #2571929 by klausi: REST entity POST request is not cacheable:...

Issue #2571929 by klausi: REST entity POST request is not cacheable: cacheability metadata is unnecessary
parent f2fe78a9
......@@ -111,7 +111,8 @@ public function post(EntityInterface $entity = NULL) {
// body.
$url = $entity->urlInfo('canonical', ['absolute' => TRUE])->toString(TRUE);
$response = new ResourceResponse($entity, 201, ['Location' => $url->getGeneratedUrl()]);
$response->addCacheableDependency($url);
// Responses after creating an entity are not cacheable, so we add no
// cacheability metadata here.
return $response;
}
catch (EntityStorageException $e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment