mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(settings): Fix log file download return type
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
9de0452071
commit
6eb843cc57
3 changed files with 17 additions and 11 deletions
|
|
@ -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"',
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@
|
|||
"headers": {
|
||||
"Content-Disposition": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"attachment; filename=\"nextcloud.log\""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -221,7 +221,10 @@
|
|||
"headers": {
|
||||
"Content-Disposition": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"attachment; filename=\"nextcloud.log\""
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue