From 8fb78d904b6df4566191623487c3e32e134745b0 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:38:45 +0100 Subject: [PATCH] Revert "nginx check regex in location field" --- package_linter.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/package_linter.py b/package_linter.py index 0065751..51f5a22 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1432,27 +1432,6 @@ class Configurations(TestSuite): f"\nOffending line(s) [{lines}]" ) - @test() - def misc_nginx_check_regex_in_location(self): - app = self.app - for filename in ( - os.listdir(app.path + "/conf") if os.path.exists(app.path + "/conf") else [] - ): - # Ignore subdirs or filename not containing nginx in the name - if ( - not os.path.isfile(app.path + "/conf/" + filename) - or "nginx" not in filename - ): - continue - - cmd = 'grep -q -IhEro "location ~ __PATH__" %s' % filename - - if os.system(cmd) != 0: - yield Warning( - "When using regexp in the nignx location field (location ~ __PATH__), start the path with ^ (location ~ ^__PATH__)." - ) - - @test() def misc_nginx_path_traversal(self):