This commit is contained in:
long2ice
2021-01-06 10:44:22 +08:00
parent c9e03ed9af
commit 7f7252d151
3 changed files with 5 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ def cache(
nonlocal expire
nonlocal key_builder
request = kwargs.get("request")
if request.headers.get("Cache-Control") == "no-store":
if request and request.headers.get("Cache-Control") == "no-store":
return await func(*args, **kwargs)
coder = coder or FastAPICache.get_coder()