CheckServerJob: Require status code 200. #2290

This commit is contained in:
Christian Kamm 2014-10-09 11:05:04 +02:00
parent 32fea6523f
commit dfba8fbe5e

View File

@ -430,7 +430,9 @@ bool CheckServerJob::finished()
bool success = false;
QByteArray body = reply()->readAll();
if( body.isEmpty() ) {
int httpStatus = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if( body.isEmpty() || httpStatus != 200) {
qDebug() << "error: status.php replied " << httpStatus << body;
emit instanceNotFound(reply());
} else {
QVariantMap status = QtJson::parse(QString::fromUtf8(body), success).toMap();