diff --git a/gns3server/api/routes/controller/symbols.py b/gns3server/api/routes/controller/symbols.py index 9701c97ea..7b9e40646 100644 --- a/gns3server/api/routes/controller/symbols.py +++ b/gns3server/api/routes/controller/symbols.py @@ -61,7 +61,7 @@ def get_symbols() -> List[dict]: # FIXME: this is a temporary workaround due to a bug in the web-ui: https://github.com/GNS3/gns3-web-ui/issues/1466 # dependencies=[Depends(has_privilege("Symbol.Audit"))] ) -async def get_symbol(symbol_id: str) -> FileResponse: +async def get_symbol(symbol_id: str, request: Request) -> Response: """ Download a symbol file. @@ -71,7 +71,12 @@ async def get_symbol(symbol_id: str) -> FileResponse: controller = Controller.instance() try: symbol = controller.symbols.get_path(symbol_id) - return FileResponse(symbol) + return FileResponse( + symbol, + headers={ + "Access-Control-Allow-Origin": request.headers.get("origin", "*"), + } + ) except (KeyError, OSError) as e: raise ControllerNotFoundError(f"Could not get symbol file: {e}")