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

fix: Use weak etags instead of etag #9

Merged
merged 2 commits into from
Feb 16, 2020
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
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: python
python:
- '2.7'
- '3.4'
- '3.5'
- 'pypy'
- '3.7'
install:
- pip install -r requirements.txt
- pip install coveralls coverage
Expand Down
2 changes: 1 addition & 1 deletion flask_rest_jsonapi/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def dispatch_request(self, *args, **kwargs):

# ETag Handling
if current_app.config.get('ETAG') == True:
etag = hashlib.sha1(resp.get_data()).hexdigest()
etag = f'W/"{hashlib.sha1(resp.get_data()).hexdigest()}"'
resp.headers['ETag'] = etag

if_match = request.headers.get('If-Match')
Expand Down