From 56b6b91b798f84e74441c4601003e4dc8f3b008f Mon Sep 17 00:00:00 2001 From: Toby Cm <62174797+tobycm@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:29:20 -0700 Subject: [PATCH] Strip leading and trailing whitespace Fixes #46 --- nginx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx.py b/nginx.py index e5b6574..e1f2e2c 100755 --- a/nginx.py +++ b/nginx.py @@ -418,6 +418,7 @@ def loads(data, conf=True): f = Conf() if conf else [] lopen = [] index = 0 + data = data.strip() while True: m = re.compile(r'^\s*events\s*{').search(data[index:])