mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add missing header and code updates
This commit is contained in:
parent
1fa20083c4
commit
c08c22bf6a
@ -256,7 +256,6 @@ httpResponse ProviderRestApi::getResponse(QNetworkReply* const& reply)
|
|||||||
|
|
||||||
if (reply->error() == QNetworkReply::NoError)
|
if (reply->error() == QNetworkReply::NoError)
|
||||||
{
|
{
|
||||||
if ( httpStatusCode != HttpStatusCode::NoContent ){
|
|
||||||
QByteArray replyData = reply->readAll();
|
QByteArray replyData = reply->readAll();
|
||||||
|
|
||||||
if (!replyData.isEmpty())
|
if (!replyData.isEmpty())
|
||||||
@ -280,7 +279,6 @@ httpResponse ProviderRestApi::getResponse(QNetworkReply* const& reply)
|
|||||||
response.setBody(QJsonDocument());
|
response.setBody(QJsonDocument());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString errorReason;
|
QString errorReason;
|
||||||
@ -316,13 +314,11 @@ httpResponse ProviderRestApi::getResponse(QNetworkReply* const& reply)
|
|||||||
{
|
{
|
||||||
errorReason = reply->errorString();
|
errorReason = reply->errorString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
response.setError(true);
|
response.setError(true);
|
||||||
response.setErrorReason(errorReason);
|
response.setErrorReason(errorReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create valid body which is empty
|
|
||||||
response.setBody(QJsonDocument());
|
|
||||||
}
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
#include <QTimerEvent>
|
#include <QTimerEvent>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
constexpr std::chrono::milliseconds DEFAULT_REST_TIMEOUT{ 1000 };
|
constexpr std::chrono::milliseconds DEFAULT_REST_TIMEOUT{ 1000 };
|
||||||
|
|
||||||
//Set QNetworkReply timeout without external timer
|
//Set QNetworkReply timeout without external timer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user