(apache_conf, root_path)
| 10 | return read_file("/etc/apache2/sites-available/000-default.conf") |
| 11 | |
| 12 | def clean_conf(apache_conf, root_path): |
| 13 | apache_conf = re.sub(r'\n\s.*ProxyPass\s+' + re.escape(root_path) + r'\s+.*\n', '\n', apache_conf) |
| 14 | apache_conf = re.sub(r'ProxyPass\s+' + re.escape(root_path) + r'\s+.*\n', '', apache_conf) |
| 15 | apache_conf = re.sub(r'\n\s.*ProxyPassReverse\s+' + re.escape(root_path) + r'\s+.*\n', '\n', apache_conf) |
| 16 | apache_conf = re.sub(r'ProxyPassReverse\s+' + re.escape(root_path) + r'\s+.*\n', '', apache_conf) |
| 17 | # return apache_conf |
| 18 | return re.sub(r'[ \t]+</VirtualHost>', '</VirtualHost>', apache_conf) |
| 19 | |
| 20 | def collapse_empty_lines(conf: str) -> str: |
| 21 | # Replace multiple consecutive newlines (with optional whitespace) with a single newline |
no outgoing calls
no test coverage detected