Skip to content

Commit

Permalink
bugfix: expose response header
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Oct 15, 2021
1 parent aa1add0 commit 0dfbcd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
]

ATLAS_PATH = '/atlases'
siibra_version_header='x-siibra-api-version'

# Main fastAPI application
app = FastAPI(
Expand Down Expand Up @@ -92,6 +93,7 @@
CORSMiddleware,
allow_origins=origins,
allow_methods=['GET'],
expose_headers=[siibra_version_header]
)


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0dfbcd7

Please sign in to comment.