From 307694c4940104724e5cb211ba1dc5a7c5291963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20G=C3=B6bel?= <dgoebel@techfak.uni-bielefeld.de> Date: Fri, 6 Oct 2023 11:18:43 +0200 Subject: [PATCH] Add content type header to documentation response #54 --- app/api/endpoints/workflow_version.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/endpoints/workflow_version.py b/app/api/endpoints/workflow_version.py index 05d542a..0f13b3a 100644 --- a/app/api/endpoints/workflow_version.py +++ b/app/api/endpoints/workflow_version.py @@ -289,7 +289,11 @@ async def download_workflow_documentation( if document is DocumentationEnum.PARAMETER_SCHEMA: path = workflow_mode.schema_path - return StreamingResponse(repo.download_file_stream(path, client), headers={"Cache-Control": "max-age=86400"}) + return StreamingResponse( + repo.download_file_stream(path, client), + headers={"Cache-Control": "max-age=86400"}, + media_type="application/json" if document is DocumentationEnum.PARAMETER_SCHEMA else "text/plain", + ) @router.post( -- GitLab