From f88d2f5350ef9cfc0a68d94f08a111029f0e6ee6 Mon Sep 17 00:00:00 2001 From: Anthony Lukach Date: Mon, 23 Jun 2025 12:55:55 -0700 Subject: [PATCH] fix status comparison in middlewares --- .../middleware/AuthenticationExtensionMiddleware.py | 2 +- src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py b/src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py index 28d5a22..708a8d4 100644 --- a/src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py +++ b/src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py @@ -57,7 +57,7 @@ def should_transform_response(self, request: Request, scope: Scope) -> bool: ] ), ) - and 200 >= scope["status"] < 300 + and 200 <= scope["status"] < 300 ) def transform_json(self, data: dict[str, Any], request: Request) -> dict[str, Any]: diff --git a/src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py b/src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py index 3827ec7..b845d56 100644 --- a/src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py +++ b/src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py @@ -42,7 +42,7 @@ def should_transform_response(self, request: Request, scope: Scope) -> bool: ), ] ) - and 200 >= scope["status"] < 300 + and 200 <= scope["status"] < 300 ) def transform_json(self, data: dict[str, Any], request: Request) -> dict[str, Any]: