diff --git a/.htaccess b/.htaccess index c32b182..d9f0989 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/src/Tests/System/HtaccessTest.php b/core/modules/system/src/Tests/System/HtaccessTest.php new file mode 100644 index 0000000..028956f --- /dev/null +++ b/core/modules/system/src/Tests/System/HtaccessTest.php @@ -0,0 +1,53 @@ +drupalGet('core/core.services.yml'); + $this->assertResponse(403); + // Try accessing a core module YAML file. + $this->drupalGet('core/modules/system/system.services.yml'); + $this->assertResponse(403); + + $file_params = array( + 'filename' => 'test.yml', + 'uri' => 'public://test.yml', + 'filemime' => 'text/yaml', + 'status' => FILE_STATUS_PERMANENT, + ); + // Create a new file entity. + $file = entity_create('file', $file_params); + file_put_contents($file->getFileUri(), 'test: value'); + $file->save(); + + // Access the file saved in the public files directory. + $this->drupalGet($file->url()); + $this->assertResponse(200); + } + +} diff --git a/web.config b/web.config index b71c37c..b072d9b 100644 --- a/web.config +++ b/web.config @@ -22,7 +22,7 @@ - +