Browse Source

Merge pull request #8445 from glassez/fix-webapi

Fix POST params handling. Closes #8443
adaptive-webui-19844
Vladimir Golovnev 7 years ago committed by GitHub
parent
commit
3035184d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/base/http/requestparser.cpp
  2. 4
      src/webui/api/torrentscontroller.cpp

2
src/base/http/requestparser.cpp

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

4
src/webui/api/torrentscontroller.cpp

@ -658,10 +658,10 @@ void TorrentsController::setForceStartAction() @@ -658,10 +658,10 @@ void TorrentsController::setForceStartAction()
void TorrentsController::deleteAction()
{
checkParams({"hashes", "delete_files"});
checkParams({"hashes", "deleteFiles"});
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)
{
BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteFiles);

Loading…
Cancel
Save