diff --git a/.htaccess b/.htaccess index 83cb71a042b..9a73a3d3a36 100644 --- a/.htaccess +++ b/.htaccess @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. - + Require all denied diff --git a/core/modules/system/tests/fixtures/HtaccessTest/.htaccess b/core/modules/system/tests/fixtures/HtaccessTest/.htaccess new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core/modules/system/tests/fixtures/HtaccessTest/web.config b/core/modules/system/tests/fixtures/HtaccessTest/web.config new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core/modules/system/tests/src/Functional/System/HtaccessTest.php b/core/modules/system/tests/src/Functional/System/HtaccessTest.php index 79c4766c4cc..7d8ea086ed6 100644 --- a/core/modules/system/tests/src/Functional/System/HtaccessTest.php +++ b/core/modules/system/tests/src/Functional/System/HtaccessTest.php @@ -86,6 +86,10 @@ class HtaccessTest extends BrowserTestBase { $file_paths["$path/composer.json"] = 403; $file_paths["$path/composer.lock"] = 403; + // Ensure web server configuration files cannot be accessed. + $file_paths["$path/.htaccess"] = 403; + $file_paths["$path/web.config"] = 403; + return $file_paths; } diff --git a/web.config b/web.config index 3fc5b10aa4c..8dff0b27e24 100644 --- a/web.config +++ b/web.config @@ -22,7 +22,7 @@ - +