Skip to content

Commit 5f3350c

Browse files
pavanputhraclaude
andauthored
fix(api): use Configuration.get_config() in /config endpoint (#147)
Previously the GET /config endpoint read the config file directly, bypassing the Configuration abstraction. This meant any override of config loading in subclasses or alternate config modules was ignored, causing the endpoint to always return the on-disk YAML regardless of the active config source. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4c7c79d commit 5f3350c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

server/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ async def get_vcon_count(
954954
async def get_config() -> JSONResponse:
955955
"""Get the current system configuration.
956956
957-
Reads and returns the configuration from the file specified in CONSERVER_CONFIG_FILE.
957+
Returns the current configuration via Configuration.get_config().
958958
959959
Returns:
960960
JSONResponse containing the configuration
@@ -963,8 +963,7 @@ async def get_config() -> JSONResponse:
963963
HTTPException: If there is an error reading the config file
964964
"""
965965
try:
966-
with open(os.getenv("CONSERVER_CONFIG_FILE"), "r") as f:
967-
config = yaml.safe_load(f)
966+
config = Configuration.get_config()
968967
return JSONResponse(content=config)
969968
except Exception as e:
970969
logger.error(f"Error reading config: {str(e)}")

0 commit comments

Comments
 (0)