From c796d5b4664c17180155b5a934f9514e7c6f60ed Mon Sep 17 00:00:00 2001 From: Pratap Vardhan Date: Fri, 20 Dec 2024 01:09:33 +0530 Subject: [PATCH] style: use generator expression in CacheControlMiddleware.any() (#1049) --- src/titiler/core/titiler/core/middleware.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/titiler/core/titiler/core/middleware.py b/src/titiler/core/titiler/core/middleware.py index 821d7491..da21ec83 100644 --- a/src/titiler/core/titiler/core/middleware.py +++ b/src/titiler/core/titiler/core/middleware.py @@ -50,10 +50,7 @@ async def send_wrapper(message: Message): scope["method"] in ["HEAD", "GET"] and message["status"] < self.cachecontrol_max_http_code and not any( - [ - re.match(path, scope["path"]) - for path in self.exclude_path - ] + re.match(path, scope["path"]) for path in self.exclude_path ) ): response_headers["Cache-Control"] = self.cachecontrol