File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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 ],
You can’t perform that action at this time.
0 commit comments