Skip to content
Permalink
Browse files

[stable9] Set content type when downloading log file to force downloa…

…d in some browsers (#25382)
  • Loading branch information...
PVince81 authored and DeepDiver1975 committed Jul 6, 2016
1 parent 64a1519 commit efa35d621dc7ff975468e636a5d1c153511296dc
@@ -103,6 +103,7 @@ public function getEntries($count=50, $offset=0) {
*/
public function download() {
$resp = new StreamResponse(\OC_Log_Owncloud::getLogFilePath());
$resp->addHeader('Content-Type', 'application/octet-stream');
$resp->addHeader('Content-Disposition', 'attachment; filename="owncloud.log"');
return $resp;
}
@@ -70,5 +70,8 @@ public function testDownload() {
$response = $this->logSettingsController->download();
$this->assertInstanceOf('\OCP\AppFramework\Http\StreamResponse', $response);
$headers = $response->getHeaders();
$this->assertEquals('application/octet-stream', $headers['Content-Type']);
$this->assertEquals('attachment; filename="owncloud.log"', $headers['Content-Disposition']);
}
}

0 comments on commit efa35d6

Please sign in to comment.
You can’t perform that action at this time.