Skip to content
Permalink
Browse files

[stable8.1] Set content type when downloading log file to force downl…

…oad in some browsers (#25382)
  • Loading branch information...
PVince81 authored and DeepDiver1975 committed Jul 6, 2016
1 parent 7b92dd2 commit 044ee072a647636b1a17c89265c7233b35371335
@@ -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 044ee07

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