Skip to content

Commit 5b03cb3

Browse files
authored
fix: fix status check for 2xx responses (#59)
## Summary - fix 2xx status comparison logic in AuthenticationExtensionMiddleware - fix 2xx status comparison logic in UpdateOpenApiMiddleware ## Testing - `pytest -q tests/test_openapi.py::test_no_openapi_spec_endpoint -q` *(fails: ModuleNotFoundError: No module named 'uvicorn')* - `pytest -q` *(fails: ModuleNotFoundError: No module named 'uvicorn')* ------ https://chatgpt.com/codex/tasks/task_e_6859a6df1404832e9cb300eb8e944b16
1 parent 1a75550 commit 5b03cb3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/stac_auth_proxy/middleware/AuthenticationExtensionMiddleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def should_transform_response(self, request: Request, scope: Scope) -> bool:
5757
]
5858
),
5959
)
60-
and 200 >= scope["status"] < 300
60+
and 200 <= scope["status"] < 300
6161
)
6262

6363
def transform_json(self, data: dict[str, Any], request: Request) -> dict[str, Any]:

src/stac_auth_proxy/middleware/UpdateOpenApiMiddleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def should_transform_response(self, request: Request, scope: Scope) -> bool:
4242
),
4343
]
4444
)
45-
and 200 >= scope["status"] < 300
45+
and 200 <= scope["status"] < 300
4646
)
4747

4848
def transform_json(self, data: dict[str, Any], request: Request) -> dict[str, Any]:

0 commit comments

Comments
 (0)