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

@@ -35,4 +35,7 @@ test: deps
build: deps build: deps
@poetry build @poetry build
clean:
@rm -rf ./dist
ci: check test ci: check test

View File

@@ -27,7 +27,7 @@ def cache(
nonlocal expire nonlocal expire
nonlocal key_builder nonlocal key_builder
request = kwargs.get("request") 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) return await func(*args, **kwargs)
coder = coder or FastAPICache.get_coder() coder = coder or FastAPICache.get_coder()

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "fastapi-cache2" name = "fastapi-cache2"
version = "0.1.3" version = "0.1.3.1"
description = "Cache for FastAPI" description = "Cache for FastAPI"
authors = ["long2ice <long2ice@gmail.com>"] authors = ["long2ice <long2ice@gmail.com>"]
license = "Apache-2.0" license = "Apache-2.0"