diff --git a/backend/apps/app_factory.py b/backend/apps/app_factory.py index a6ffc3cb7..e70a132e6 100644 --- a/backend/apps/app_factory.py +++ b/backend/apps/app_factory.py @@ -51,6 +51,7 @@ def create_app( allow_credentials=True, allow_methods=cors_methods or ["*"], allow_headers=["*"], + expose_headers=["conversation_id"], ) # Register exception handlers diff --git a/test/backend/app/test_config_app.py b/test/backend/app/test_config_app.py index 7ceacdcf8..60b42c70b 100644 --- a/test/backend/app/test_config_app.py +++ b/test/backend/app/test_config_app.py @@ -82,6 +82,7 @@ def test_config_app_default_cors_config(self): assert cors_middleware.kwargs.get("allow_credentials") is True assert cors_middleware.kwargs.get("allow_methods") == ["*"] assert cors_middleware.kwargs.get("allow_headers") == ["*"] + assert cors_middleware.kwargs.get("expose_headers") == ["conversation_id"] class TestConfigAppRouterConfiguration: diff --git a/test/backend/app/test_northbound_base_app.py b/test/backend/app/test_northbound_base_app.py index 20e911ec4..a25da2364 100644 --- a/test/backend/app/test_northbound_base_app.py +++ b/test/backend/app/test_northbound_base_app.py @@ -316,6 +316,7 @@ def test_cors_middleware_configuration(self): self.assertTrue(cors_middleware.kwargs.get("allow_credentials")) self.assertEqual(cors_middleware.kwargs.get("allow_methods"), ["GET", "POST", "PUT", "DELETE"]) self.assertEqual(cors_middleware.kwargs.get("allow_headers"), ["*"]) + self.assertEqual(cors_middleware.kwargs.get("expose_headers"), ["conversation_id"]) def test_router_inclusion(self): """The main northbound router should be included."""