mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
fix: request / router KeyError
This commit is contained in:
@@ -78,9 +78,9 @@ def cache(
|
||||
# if the wrapped function does NOT have request or response in its function signature,
|
||||
# make sure we don't pass them in as keyword arguments
|
||||
if not request_param:
|
||||
kwargs.pop("request")
|
||||
kwargs.pop("request", None)
|
||||
if not response_param:
|
||||
kwargs.pop("response")
|
||||
kwargs.pop("response", None)
|
||||
|
||||
if inspect.iscoroutinefunction(func):
|
||||
# async, return as is.
|
||||
|
||||
Reference in New Issue
Block a user