mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
fix headers if cache encoder return custom response
This commit is contained in:
@@ -221,7 +221,8 @@ def cache(
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
result = cast(R, coder.decode_as_type(cached, type_=return_type))
|
result = cast(R, coder.decode_as_type(cached, type_=return_type))
|
||||||
|
if isinstance(result, Response):
|
||||||
|
result.headers.update(response.headers)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
inner.__signature__ = _augment_signature(wrapped_signature, *to_inject) # type: ignore[attr-defined]
|
inner.__signature__ = _augment_signature(wrapped_signature, *to_inject) # type: ignore[attr-defined]
|
||||||
|
|||||||
Reference in New Issue
Block a user