Merge pull request #258 from nextcloud/set-disposition

Set content-type to "application/octet-stream"
This commit is contained in:
Marius Blüm 2016-06-30 14:27:43 +02:00 committed by GitHub
commit 2cdee70305
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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);
}
}