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

Quote etag values. #1084

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
- Speed up validating annotations with user fields ([#1078](../../pull/1078))
- Speed up validating annotation colors ([#1080](../../pull/1080))
- Support more complex bands from the test source ([#1082](../../pull/1082))
- Improve error thrown for invalid schema with multi source ([#1083](../../pull/1083))

### Bug Fixes
- The cache could reuse a class inappropriately ([#1070](../../pull/1070))
- Increase size of annotation json that will be parsed ([#1075](../../pull/1075))
- Quote ETag tags ([#1084](../../pull/1084))

## 1.20.1

Expand Down
4 changes: 2 additions & 2 deletions girder/girder_large_image/rest/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _handleETag(key, item, *args, **kwargs):
"""
Add or check an ETag header.

:param key: key for making a distinc etag.
:param key: key for making a distinct etag.
:param item: item used for the item _id and updated timestamp.
:param max_age: the maximum cache duration.
:param *args, **kwargs: additional arguments for generating an etag.
Expand All @@ -90,7 +90,7 @@ def _handleETag(key, item, *args, **kwargs):
id = str(item['_id'])
date = item.get('updated', item.get('created'))
etag = hashlib.md5(strhash(key, id, date, *args, **kwargs).encode()).hexdigest()
setResponseHeader('ETag', etag)
setResponseHeader('ETag', '"%s"' % etag)
conditions = [str(x) for x in cherrypy.request.headers.elements('If-Match') or []]
if conditions and not (conditions == ['*'] or etag in conditions):
raise cherrypy.HTTPError(
Expand Down