summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorAlex Pott2016-02-11 14:33:13 +0000
committerAlex Pott2016-02-11 14:33:13 +0000
commitb2734bbd73785e6c511d2f407825effb8d4f61f3 (patch)
tree7a3d1bc0c6743cdcdb9418dd109826d46f237862 /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parentf2fe78a9a86f7dcd04f32c87ea611df345893143 (diff)
Issue #2571929 by klausi: REST entity POST request is not cacheable: cacheability metadata is unnecessary
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index a2d712d..cbe6e2e 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -111,7 +111,8 @@ class EntityResource extends ResourceBase {
// 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) {