We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 406e767 + 84ec7ee commit 008cc3fCopy full SHA for 008cc3f
openlibrary/asgi_app.py
@@ -154,6 +154,13 @@ def create_app() -> FastAPI:
154
155
setup_i18n(app)
156
157
+ @app.middleware("http")
158
+ async def add_fastapi_header(request: Request, call_next):
159
+ """Middleware to add a header indicating the response came from FastAPI."""
160
+ response = await call_next(request)
161
+ response.headers["X-Served-By"] = "FastAPI"
162
+ return response
163
+
164
# --- Fast routes (mounted within this app) ---
165
@app.get("/health")
166
def health() -> dict[str, str]:
0 commit comments