api: Make knownOrigins parsing logic more robust.

This commit is contained in:
Jonathan Bernard 2024-08-12 17:31:29 -05:00
parent f848514df1
commit 7992691d94

View File

@ -30,7 +30,7 @@ proc loadConfig(args: Table[string, docopt.Value]): HffEntryFormsApiConfig =
debug: cfg.hasKey("debug") and cfg.getVal("debug") == "true",
eventParentId: cfg.getVal("event-parent-id"),
integrationToken: cfg.getVal("integration-token"),
knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it[1..^2]),
knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it.strip[1..^2]),
notionApiBaseUrl: cfg.getVal("notion-api-base-url"),
notionVersion: cfg.getVal("notion-version"),
notionConfigDbId: cfg.getVal("notion-config-db-id"),