Skip to content

Commit

Permalink
Quote etag values.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Mar 17, 2023
1 parent 6cfd352 commit 369ac7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 369ac7e

Please sign in to comment.