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
commit 60bb819e2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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"));
}