aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller/LogSettingsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/lib/Controller/LogSettingsController.php')
-rw-r--r--apps/settings/lib/Controller/LogSettingsController.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/settings/lib/Controller/LogSettingsController.php b/apps/settings/lib/Controller/LogSettingsController.php
index 08c18189d03..4a28c3d17e4 100644
--- a/apps/settings/lib/Controller/LogSettingsController.php
+++ b/apps/settings/lib/Controller/LogSettingsController.php
@@ -8,6 +8,7 @@
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license AGPL-3.0
*
@@ -28,6 +29,7 @@ namespace OCA\Settings\Controller;
use OC\Log;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http;
use OCP\AppFramework\Http\StreamResponse;
use OCP\IRequest;
@@ -46,15 +48,19 @@ class LogSettingsController extends Controller {
*
* @NoCSRFRequired
*
- * @return StreamResponse
+ * @psalm-suppress MoreSpecificReturnType The value of Content-Disposition is not relevant
+ * @psalm-suppress LessSpecificReturnStatement The value of Content-Disposition is not relevant
+ * @return StreamResponse<Http::STATUS_OK, array{Content-Type: 'application/octet-stream', 'Content-Disposition': string}>
*/
public function download() {
if (!$this->log instanceof Log) {
throw new \UnexpectedValueException('Log file not available');
}
$resp = new StreamResponse($this->log->getLogPath());
- $resp->addHeader('Content-Type', 'application/octet-stream');
- $resp->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"');
+ $resp->setHeaders([
+ 'Content-Type' => 'application/octet-stream',
+ 'Content-Disposition' => 'attachment; filename="nextcloud.log"',
+ ]);
return $resp;
}
}