1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

[py3] Always fed hashlib with bytes.

This commit is contained in:
Łukasz Langa
2013-02-27 04:26:15 +01:00
committed by Aymeric Augustin
parent a28e2e7c4d
commit 40b9f4fb8b
4 changed files with 16 additions and 15 deletions

View File

@@ -181,7 +181,7 @@ def _generate_cache_key(request, method, headerlist, key_prefix):
for header in headerlist:
value = request.META.get(header, None)
if value is not None:
ctx.update(value)
ctx.update(force_bytes(value))
path = hashlib.md5(force_bytes(iri_to_uri(request.get_full_path())))
cache_key = 'views.decorators.cache.cache_page.%s.%s.%s.%s' % (
key_prefix, method, path.hexdigest(), ctx.hexdigest())