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:
commit
3035184d25
@ -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;
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user