Skip to content

Commit 7a682d1

Browse files
committed
patch content length issue
src a-luna#71
1 parent 233835b commit 7a682d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fastapi_redis_cache/cache.py

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ async def inner_wrapper(*args, **kwargs):
3939
create_response_directly = not response
4040
if create_response_directly:
4141
response = Response()
42+
if "content-length" in response.headers.keys():
43+
del response.headers["content-length"]
4244
redis_cache = FastApiRedisCache()
4345
if redis_cache.not_connected or redis_cache.request_is_not_cacheable(request):
4446
# if the redis client is not connected or request is not cacheable, no caching behavior is performed.

0 commit comments

Comments
 (0)