abhijeets25012-tech commented on code in PR #61043:
URL: https://github.com/apache/airflow/pull/61043#discussion_r2727105606
##########
airflow-core/src/airflow/api_fastapi/core_api/app.py:
##########
@@ -180,8 +181,11 @@ def init_error_handlers(app: FastAPI) -> None:
def init_middlewares(app: FastAPI) -> None:
from airflow.api_fastapi.auth.middlewares.refresh_token import
JWTRefreshMiddleware
+
app.add_middleware(JWTRefreshMiddleware)
if conf.getboolean("core", "simple_auth_manager_all_admins"):
from airflow.api_fastapi.auth.managers.simple.middleware import
SimpleAllAdminMiddleware
app.add_middleware(SimpleAllAdminMiddleware)
+ app.add_middleware(GZipMiddleware, minimum_size=1024, compresslevel=5)
Review Comment:
Fix middleware order in FastAPI app
- Added JWTRefreshMiddleware first
- Added SimpleAllAdminMiddleware if enabled
- GZipMiddleware runs last
- Ensures proper API response and avoids chunked transfer issues
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]