Poll URL: Use trimmed() on response

This commit is contained in:
Markus Goetz 2014-08-29 13:58:33 +02:00
parent 2aef6a2174
commit 7ec0c52439

View file

@ -120,7 +120,9 @@ bool PollJob::finished()
}
bool ok = false;
QVariantMap status = QtJson::parse(QString::fromUtf8(reply()->readAll()), ok).toMap();
QByteArray jsonData = reply()->readAll().trimmed();
qDebug() << Q_FUNC_INFO << ">" << jsonData << "<";
QVariantMap status = QtJson::parse(QString::fromUtf8(jsonData), ok).toMap();
if (!ok || status.isEmpty()) {
_item._errorString = tr("Invalid json reply from the poll URL");
_item._status = SyncFileItem::NormalError;