fix tests and default response

pull/135/head
Simon Stürz 2015-08-03 00:08:41 +02:00 committed by Michael Zanetti
parent 660f91b165
commit 84a84b30d0
2 changed files with 4 additions and 4 deletions

View File

@ -219,7 +219,7 @@ void WebServer::incomingConnection(qintptr socketDescriptor)
socket->setLocalCertificate(m_certificate);
connect(socket, SIGNAL(encrypted()), this, SLOT(onEncrypted()));
socket->startServerEncryption();
// wait for encrypted connection before continue
// wait for encrypted connection before continue with this client
return;
}
@ -319,8 +319,8 @@ void WebServer::readClient()
}
// reject everything else...
qCWarning(dcWebServer) << "Unknown message received. Respond client with 501: Not Implemented.";
HttpReply reply(HttpReply::NotImplemented);
qCWarning(dcWebServer) << "Unknown message received. Respond client with 400: Not Implemented.";
HttpReply reply(HttpReply::NotFound);
reply.setPayload("404 Not found.");
writeData(socket, reply.data());
}

View File

@ -142,7 +142,7 @@ void TestWebserver::multiPackageMessage()
bool ok = false;
int statusCode = firstLineTokens.at(1).toInt(&ok);
QVERIFY2(ok, "Could not convert statuscode from response to int");
QCOMPARE(statusCode, 501);
QCOMPARE(statusCode, 404);
socket->close();
socket->deleteLater();