Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resources: add etag headers #1024

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions invenio_communities/communities/resources/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
),
}
Loading