diff options
-rw-r--r-- | apps/settings/lib/Controller/LogSettingsController.php | 18 | ||||
-rw-r--r-- | apps/settings/openapi-administration.json | 5 | ||||
-rw-r--r-- | apps/settings/openapi-full.json | 5 |
3 files changed, 17 insertions, 11 deletions
diff --git a/apps/settings/lib/Controller/LogSettingsController.php b/apps/settings/lib/Controller/LogSettingsController.php index aa5ac9b2cc9..7cf8d631c8e 100644 --- a/apps/settings/lib/Controller/LogSettingsController.php +++ b/apps/settings/lib/Controller/LogSettingsController.php @@ -27,9 +27,7 @@ class LogSettingsController extends Controller { /** * 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<Http::STATUS_OK, array{Content-Type: 'application/octet-stream', 'Content-Disposition': string}> + * @return StreamResponse<Http::STATUS_OK, array{Content-Type: 'application/octet-stream', 'Content-Disposition': 'attachment; filename="nextcloud.log"'}> * * 200: Logfile returned */ @@ -38,11 +36,13 @@ class LogSettingsController extends Controller { 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 090ef865371..1f6eb0bc652 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 b5cbfda7096..e12598a2584 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\"" + ] } } }, |