diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-06-30 12:43:58 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-06-30 12:47:46 +0200 |
commit | 700a57d8b69dcabfef3e4e27911e2db2ea96b9c6 (patch) | |
tree | 709da1194f520c0a566bb0f709bbcdf97b0a507d /tests | |
parent | f7a69c765af490767fcd765f06086f7604fdbc43 (diff) | |
download | nextcloud-server-700a57d8b69dcabfef3e4e27911e2db2ea96b9c6.tar.gz nextcloud-server-700a57d8b69dcabfef3e4e27911e2db2ea96b9c6.zip |
Set content-type to "application/octet-stream"
Some browsers such as Firefox on Microsoft Windows otherwise do offer to open the file directly which is kinda silly.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Settings/Controller/LogSettingsControllerTest.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/Settings/Controller/LogSettingsControllerTest.php b/tests/Settings/Controller/LogSettingsControllerTest.php index 092c04aecc7..e3cfa072d08 100644 --- a/tests/Settings/Controller/LogSettingsControllerTest.php +++ b/tests/Settings/Controller/LogSettingsControllerTest.php @@ -12,6 +12,7 @@ namespace Tests\Settings\Controller; use \OC\Settings\Application; use OC\Settings\Controller\LogSettingsController; +use OCP\AppFramework\Http\StreamResponse; /** * @package Tests\Settings\Controller @@ -70,6 +71,9 @@ class LogSettingsControllerTest extends \Test\TestCase { public function testDownload() { $response = $this->logSettingsController->download(); - $this->assertInstanceOf('\OCP\AppFramework\Http\StreamResponse', $response); + $expected = new StreamResponse(\OC\Log\Owncloud::getLogFilePath()); + $expected->addHeader('Content-Type', 'application/octet-stream'); + $expected->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"'); + $this->assertEquals($expected, $response); } } |