From 0dfbcd706c47d8f20303c3457440a67f0d9e5424 Mon Sep 17 00:00:00 2001 From: Xiao Gui Date: Fri, 15 Oct 2021 09:24:25 +0200 Subject: [PATCH] bugfix: expose response header --- app/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/app.py b/app/app.py index 032d42a..809d82d 100644 --- a/app/app.py +++ b/app/app.py @@ -60,6 +60,7 @@ ] ATLAS_PATH = '/atlases' +siibra_version_header='x-siibra-api-version' # Main fastAPI application app = FastAPI( @@ -92,6 +93,7 @@ CORSMiddleware, allow_origins=origins, allow_methods=['GET'], + expose_headers=[siibra_version_header] ) @@ -210,7 +212,7 @@ async def matomo_request_log(request: Request, call_next): @app.middleware('http') async def add_version_header(request: Request, call_next): response = await call_next(request) - response.headers["X-Siibra-Api-Version"] = __version__ + response.headers[siibra_version_header] = __version__ return response @app.get('/ready', include_in_schema=False)