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 c0c9ee04ca3..8750cc6e188 100644
--- a/settings/controller/logsettingscontroller.php
+++ b/settings/controller/logsettingscontroller.php
@@ -103,7 +103,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 60680ba4647..3c290767e07 100644
--- a/tests/settings/controller/logsettingscontrollertest.php
+++ b/tests/settings/controller/logsettingscontrollertest.php
@@ -11,6 +11,7 @@ namespace Test\Settings\Controller;
use \OC\Settings\Application;
use OC\Settings\Controller\LogSettingsController;
+use OCP\AppFramework\Http\StreamResponse;
/**
* @package OC\Settings\Controller
@@ -69,6 +70,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);
}
}