From 82b715f06801d356e0714f497ef25636a8a8bdec Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Mar 2019 19:22:43 +0100 Subject: [PATCH] Handle case were { is on a newline --- package_linter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package_linter.py b/package_linter.py index 2ad01cb..c5edcb9 100755 --- a/package_linter.py +++ b/package_linter.py @@ -169,7 +169,7 @@ class App(): lines_iter = lines.__iter__() for line in lines_iter: if line.startswith("location"): - location_line = line + location_line = line.split() break # Look at the next lines for an 'alias' directive if location_line is not None: @@ -181,7 +181,7 @@ class App(): if line.startswith("alias"): # We should definitely check for path traversal issue # Does the location target ends with / ? - target = location_line.split()[-2] + target = location_line[-2] if location_line[-1] == "{" else location_line[-1] if not target.endswith("/"): path_traversal_vulnerable = True break