mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Handle case were { is on a newline
This commit is contained in:
parent
f6e98894cf
commit
82b715f068
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue