summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--settings/Controller/LogSettingsController.php3
-rw-r--r--tests/Settings/Controller/LogSettingsControllerTest.php6
2 files changed, 7 insertions, 2 deletions
diff --git a/settings/Controller/LogSettingsController.php b/settings/Controller/LogSettingsController.php
index 4863c2369be..6c9fe76c247 100644
--- a/settings/Controller/LogSettingsController.php
+++ b/settings/Controller/LogSettingsController.php
@@ -105,7 +105,8 @@ class LogSettingsController extends Controller {
*/
public function download() {
$resp = new StreamResponse(\OC\Log\Owncloud::getLogFilePath());
- $resp->addHeader('Content-Disposition', 'attachment; filename="owncloud.log"');
+ $resp->addHeader('Content-Type', 'application/octet-stream');
+ $resp->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"');
return $resp;
}
}
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);
}
}