Skip to content

Commit

Permalink
draft/wip test_content_cache issue
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Apr 25, 2024
1 parent 699e2cc commit d340c15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pulp_container/app/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def make_response(self, key, base_key):
# the cache as a regular string; now, it is necessary to translate the data back
# to its original representation that will be returned in the HTTP response BODY:
# https://docs.aiohttp.org/en/stable/web_reference.html#response
entry["data"] = bytes.fromhex(binary)
response_type = binary
entry["content"] = bytes.fromhex(binary)
response_type = "Response"
# None means "doesn't expire", unset means "already expired".
expires = entry.pop("expires", -1)
if (not response_type or response_type not in self.RESPONSE_TYPES) or (
Expand Down Expand Up @@ -104,7 +104,7 @@ def make_entry(self, key, base_key, handler, args, kwargs, expires=None):
elif isinstance(response, HttpResponse):
entry["type"] = "Response"
if isinstance(response.data, bytes):
entry["data"] = response.data.hex()
entry["content"] = response.data.hex()
else:
entry["content"] = response.content.decode("utf-8")
else:
Expand Down

0 comments on commit d340c15

Please sign in to comment.