From 01244a0d11f3cc9c1b6bc251a2c72f0bc04ecc42 Mon Sep 17 00:00:00 2001 From: Zacharias Zacharodimos Date: Wed, 20 Sep 2023 17:30:30 +0200 Subject: [PATCH] resources: add etag headers --- invenio_communities/communities/resources/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invenio_communities/communities/resources/config.py b/invenio_communities/communities/resources/config.py index d7618c5ce..fe093e143 100644 --- a/invenio_communities/communities/resources/config.py +++ b/invenio_communities/communities/resources/config.py @@ -17,6 +17,7 @@ ) from invenio_i18n import lazy_gettext as _ from invenio_records_resources.resources import RecordResourceConfig +from invenio_records_resources.resources.records.headers import etag_headers from invenio_records_resources.services.base.config import ConfiguratorMixin, FromConfig from invenio_requests.resources.requests.config import RequestSearchRequestArgsSchema @@ -100,8 +101,8 @@ class CommunityResourceConfig(RecordResourceConfig, ConfiguratorMixin): request_community_requests_search_args = RequestSearchRequestArgsSchema response_handlers = { - "application/json": ResponseHandler(JSONSerializer()), + "application/json": ResponseHandler(JSONSerializer(), headers=etag_headers), "application/vnd.inveniordm.v1+json": ResponseHandler( - UICommunityJSONSerializer() + UICommunityJSONSerializer(), headers=etag_headers ), }