fix, getsubject works

This commit is contained in:
Ondřej Fischer 2019-10-07 16:49:11 +02:00
parent 41422bfb6e
commit dcc88a669b
2 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@ RequestManager::RequestManager()
{
manager = new QNetworkAccessManager();
token = "";
loginStatus = true; //should be false, true for testing request header
loginStatus = false; //should be false, true for testing request header
/*
@ -57,9 +57,9 @@ void RequestManager::getRequest(QString endpoint)
{
// login(config.object()["host"].toString(), config.object()["username"].toString(), config.object()["password"].toString());
login(host, user, password);
// QEventLoop loop;
// QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
// loop.exec();
QEventLoop loop;
QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
loop.exec();
}
//
@ -68,7 +68,7 @@ void RequestManager::getRequest(QString endpoint)
QNetworkRequest request;
request.setUrl(host + endpoint);
qDebug() << authHeader;
qDebug() << "Auth: " << authHeader;
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
//request.setRawHeader("User-Agent", "curl/7.65.3");
//request.setRawHeader("Connection", "Keep-Alive");

View File

@ -61,8 +61,8 @@ private:
QNetworkAccessManager* manager;
QJsonDocument config;
QString authHeader;
//QString host = "https://192.168.1.3:8443";
QString host = "http://localhost:8080";
QString host = "https://192.168.1.3:8443";
//QString host = "http://localhost:8080";
QString password = "spaceti1";
QString user = "spaceti";