diff --git a/apps/settings/lib/Controller/LogSettingsController.php b/apps/settings/lib/Controller/LogSettingsController.php index aa5ac9b2cc9fd..7cf8d631c8ebd 100644 --- a/apps/settings/lib/Controller/LogSettingsController.php +++ b/apps/settings/lib/Controller/LogSettingsController.php @@ -27,9 +27,7 @@ public function __construct(string $appName, IRequest $request, Log $logger) { /** * download logfile * - * @psalm-suppress MoreSpecificReturnType The value of Content-Disposition is not relevant - * @psalm-suppress LessSpecificReturnStatement The value of Content-Disposition is not relevant - * @return StreamResponse + * @return StreamResponse * * 200: Logfile returned */ @@ -38,11 +36,13 @@ public function download() { if (!$this->log instanceof Log) { throw new \UnexpectedValueException('Log file not available'); } - $resp = new StreamResponse($this->log->getLogPath()); - $resp->setHeaders([ - 'Content-Type' => 'application/octet-stream', - 'Content-Disposition' => 'attachment; filename="nextcloud.log"', - ]); - return $resp; + return new StreamResponse( + $this->log->getLogPath(), + Http::STATUS_OK, + [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="nextcloud.log"', + ], + ); } } diff --git a/apps/settings/openapi-administration.json b/apps/settings/openapi-administration.json index 090ef865371fb..1f6eb0bc652b7 100644 --- a/apps/settings/openapi-administration.json +++ b/apps/settings/openapi-administration.json @@ -44,7 +44,10 @@ "headers": { "Content-Disposition": { "schema": { - "type": "string" + "type": "string", + "enum": [ + "attachment; filename=\"nextcloud.log\"" + ] } } }, diff --git a/apps/settings/openapi-full.json b/apps/settings/openapi-full.json index b5cbfda7096f8..e12598a258423 100644 --- a/apps/settings/openapi-full.json +++ b/apps/settings/openapi-full.json @@ -221,7 +221,10 @@ "headers": { "Content-Disposition": { "schema": { - "type": "string" + "type": "string", + "enum": [ + "attachment; filename=\"nextcloud.log\"" + ] } } },