diff --git a/CHANGES/+cache_api_response_content_type.bugfix b/CHANGES/+cache_api_response_content_type.bugfix new file mode 100644 index 00000000000..314dc5afa06 --- /dev/null +++ b/CHANGES/+cache_api_response_content_type.bugfix @@ -0,0 +1 @@ +Fixed cache forgetting the Content-Type header of ApiResponses diff --git a/pulpcore/cache/cache.py b/pulpcore/cache/cache.py index 637bda94e12..4fdaf7d691f 100644 --- a/pulpcore/cache/cache.py +++ b/pulpcore/cache/cache.py @@ -217,6 +217,7 @@ def make_entry(self, key, base_key, handler, args, kwargs, expires=DEFAULT_EXPIR entry["type"] = "FileResponse" elif isinstance(response, ApiResponse): entry["data"] = response.data + entry["content_type"] = response.content_type entry["type"] = "APIResponse" elif isinstance(response, HttpResponse): entry["content"] = response.content.decode("utf-8")