Merge remote-tracking branch 'origin/master'

# Conflicts:
#	fastapi_cache/decorator.py
#	poetry.lock
This commit is contained in:
long2ice
2021-01-06 10:35:06 +08:00
2 changed files with 8 additions and 2 deletions

View File

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