1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-03 10:25:02 +00:00

Merge pull request #8445 from glassez/fix-webapi

Fix POST params handling. Closes #8443
This commit is contained in:
Vladimir Golovnev 2018-02-20 11:11:33 +03:00 committed by GitHub
commit 3035184d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -217,7 +217,7 @@ bool RequestParser::parseContent(const QByteArray &data)
QListIterator<QPair<QString, QString> > i(QUrlQuery(url).queryItems(QUrl::FullyDecoded)); QListIterator<QPair<QString, QString> > i(QUrlQuery(url).queryItems(QUrl::FullyDecoded));
while (i.hasNext()) { while (i.hasNext()) {
QPair<QString, QString> pair = i.next(); QPair<QString, QString> pair = i.next();
m_request.posts[pair.first.toLower()] = pair.second; m_request.posts[pair.first] = pair.second;
} }
return true; return true;

View File

@ -658,10 +658,10 @@ void TorrentsController::setForceStartAction()
void TorrentsController::deleteAction() void TorrentsController::deleteAction()
{ {
checkParams({"hashes", "delete_files"}); checkParams({"hashes", "deleteFiles"});
const QStringList hashes {params()["hashes"].split('|')}; const QStringList hashes {params()["hashes"].split('|')};
const bool deleteFiles {parseBool(params()["delete_files"], false)}; const bool deleteFiles {parseBool(params()["deleteFiles"], false)};
applyToTorrents(hashes, [deleteFiles](BitTorrent::TorrentHandle *torrent) applyToTorrents(hashes, [deleteFiles](BitTorrent::TorrentHandle *torrent)
{ {
BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteFiles); BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteFiles);