Skip to content

Commit

Permalink
fix(settings): Fix log file download return type
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and backportbot[bot] committed Jan 8, 2025
1 parent 5e80c08 commit cc6cfda
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
14 changes: 8 additions & 6 deletions apps/settings/lib/Controller/LogSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,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"',
],
);
}
}
5 changes: 4 additions & 1 deletion apps/settings/openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
"headers": {
"Content-Disposition": {
"schema": {
"type": "string"
"type": "string",
"enum": [
"attachment; filename=\"nextcloud.log\""
]
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion apps/settings/openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@
"headers": {
"Content-Disposition": {
"schema": {
"type": "string"
"type": "string",
"enum": [
"attachment; filename=\"nextcloud.log\""
]
}
}
},
Expand Down

0 comments on commit cc6cfda

Please sign in to comment.