diff --git a/Makefile b/Makefile index d6b9802..021a58c 100644 --- a/Makefile +++ b/Makefile @@ -35,4 +35,7 @@ test: deps build: deps @poetry build +clean: + @rm -rf ./dist + ci: check test diff --git a/fastapi_cache/decorator.py b/fastapi_cache/decorator.py index 93d1363..ee469a9 100644 --- a/fastapi_cache/decorator.py +++ b/fastapi_cache/decorator.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 9ad6bf9..ee6242c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fastapi-cache2" -version = "0.1.3" +version = "0.1.3.1" description = "Cache for FastAPI" authors = ["long2ice "] license = "Apache-2.0"