summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorAlex Pott2015-04-15 17:40:19 +0200
committerAlex Pott2015-04-15 17:40:19 +0200
commitbf9a2f39fcae50ffe46809f994539b85f64101c9 (patch)
tree9d22a66272da6154c03e869572a376e4e71a0a2b /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parentee12606d08db353be91d7bc9fa02c70917aca4c0 (diff)
Issue #2471473 by klausi, pwolanin: REST responses should have proper cache tags
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 b07f3e6..2c5eea9 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -54,7 +54,8 @@ class EntityResource extends ResourceBase {
unset($entity->{$field_name});
}
}
- return new ResourceResponse($entity);
+
+ return new ResourceResponse($entity, 200, ['X-Drupal-Cache-Tags' => implode(' ', $entity->getCacheTags())]);
}
/**