Skip to content

Commit 5ac1251

Browse files
committed
Make Serializer.dumps() require a body parameter.
When caching permanent redirects, if `body` is left to `None`, there's an infinite recursion that will lead to the caching to silently fail and not cache anything at all. So instead, make `body` a required parameter, which can be empty (`''`) for cached redirects.
1 parent 0763108 commit 5ac1251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cachecontrol/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def cache_response(self, request, response, body=None, status_codes=None):
284284
cc = self.parse_cache_control(response_headers)
285285

286286
cache_url = self.cache_url(request.url)
287-
logger.debug('Updating cache %r with response from "%s"', self.cache, cache_url)
287+
logger.debug('Updating cache with response from "%s"', cache_url)
288288

289289
# Delete it from the cache if we happen to have it stored there
290290
no_store = False

0 commit comments

Comments
 (0)