diff options
author | provokateurin <kate@provokateurin.de> | 2024-12-16 16:18:40 +0100 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2025-01-07 15:44:48 +0100 |
commit | 960168fd963bae12a347bb7c3b77108c21b4fb0d (patch) | |
tree | 49d3a5677114fec04bade9a9626cd338417843f3 /apps/settings | |
parent | 17e89483606bf41eb8b9e9193c08fe351d79804e (diff) | |
download | nextcloud-server-960168fd963bae12a347bb7c3b77108c21b4fb0d.tar.gz nextcloud-server-960168fd963bae12a347bb7c3b77108c21b4fb0d.zip |
fix(settings): Fix log file download return type
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/settings')
-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\"" + ] } } }, |