From 22807ee3931de679d8efb10a43899a3bb7ee8f23 Mon Sep 17 00:00:00 2001
From: Eric Callahan <arksine.code@gmail.com>
Date: Sat, 20 Nov 2021 08:58:23 -0500
Subject: [PATCH] authorization: use extended confighelper methods

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
---
 moonraker/components/authorization.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/moonraker/components/authorization.py b/moonraker/components/authorization.py
index 3e8d727..d530ad6 100644
--- a/moonraker/components/authorization.py
+++ b/moonraker/components/authorization.py
@@ -134,9 +134,7 @@ class Authorization:
 
         # Get allowed cors domains
         self.cors_domains: List[str] = []
-        cors_cfg = config.get('cors_domains', "").strip()
-        cds = [d.strip() for d in cors_cfg.split('\n') if d.strip()]
-        for domain in cds:
+        for domain in config.getlist('cors_domains', []):
             bad_match = re.search(r"^.+\.[^:]*\*", domain)
             if bad_match is not None:
                 raise config.error(
@@ -155,9 +153,7 @@ class Authorization:
         self.trusted_ips: List[IPAddr] = []
         self.trusted_ranges: List[IPNetwork] = []
         self.trusted_domains: List[str] = []
-        tcs = config.get('trusted_clients', "")
-        trusted_clients = [c.strip() for c in tcs.split('\n') if c.strip()]
-        for val in trusted_clients:
+        for val in config.getlist('trusted_clients', []):
             # Check IP address
             try:
                 tc = ipaddress.ip_address(val)