Allow WebAPI to specify filename and mime type for result data

PR #20377.
This commit is contained in:
Vladimir Golovnev
2024-02-12 09:07:09 +03:00
committed by GitHub
parent 8ef99b336c
commit 60bb819e2e
4 changed files with 43 additions and 19 deletions

View File

@@ -1442,5 +1442,5 @@ void TorrentsController::exportAction()
if (!result)
throw APIError(APIErrorType::Conflict, tr("Unable to export torrent file. Error: %1").arg(result.error()));
setResult(result.value());
setResult(result.value(), u"application/x-bittorrent"_s, (id.toString() + u".torrent"));
}