Skip to content

Commit b0020a6

Browse files
author
Joshua Rogers
authored
Update proxy_pass_normalized.py
1 parent b7168db commit b0020a6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gixy/plugins/proxy_pass_normalized.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, config):
2424

2525
def audit(self, directive):
2626
proxy_pass_args = directive.args
27+
using_replace_pattern = False
2728

2829
if not proxy_pass_args:
2930
return
@@ -33,16 +34,16 @@ def audit(self, directive):
3334
if not parsed:
3435
return
3536

36-
if not parsed.group('path'):
37-
return
38-
39-
4037
for rewrite in directive.find_directives_in_scope("rewrite"):
4138
if hasattr(rewrite, 'pattern') and hasattr(rewrite, 'replace'):
4239
if rewrite.pattern == '^' and rewrite.replace == '$request_uri':
43-
if '$' in parsed.group('path'):
40+
using_replace_pattern = True
41+
if parsed.group('path') and '$' in parsed.group('path'):
4442
return
4543

44+
if not parsed.group('path') and not using_replace_pattern:
45+
return
46+
4647
self.add_issue(
4748
severity=self.severity,
4849
directive=[directive, directive.parent],

0 commit comments

Comments
 (0)