mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Adds 304 http status code as valid.
Signed-off-by: Camila San <hello@camila.codes>
This commit is contained in:
parent
77ebccee72
commit
23a759ef4a
@ -106,18 +106,24 @@ bool OcsJob::finished()
|
||||
const QByteArray replyData = reply()->readAll();
|
||||
|
||||
QJsonParseError error;
|
||||
QString message;
|
||||
int statusCode = 0;
|
||||
auto json = QJsonDocument::fromJson(replyData, &error);
|
||||
|
||||
// when it is null we might have a 304 so get status code from reply() and gives a warning...
|
||||
if (error.error != QJsonParseError::NoError) {
|
||||
statusCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
qCWarning(lcOcs) << "Could not parse reply to"
|
||||
<< _verb
|
||||
<< Utility::concatUrlPath(account()->url(), path())
|
||||
<< _params
|
||||
<< error.errorString()
|
||||
<< ":" << replyData;
|
||||
} else {
|
||||
statusCode = getJsonReturnCode(json, message);
|
||||
}
|
||||
|
||||
QString message;
|
||||
const int statusCode = getJsonReturnCode(json, message);
|
||||
//... then it checks for the statusCode
|
||||
if (!_passStatusCodes.contains(statusCode)) {
|
||||
qCWarning(lcOcs) << "Reply to"
|
||||
<< _verb
|
||||
@ -125,6 +131,7 @@ bool OcsJob::finished()
|
||||
<< _params
|
||||
<< "has unexpected status code:" << statusCode << replyData;
|
||||
emit ocsError(statusCode, message);
|
||||
|
||||
} else {
|
||||
// save new ETag value
|
||||
if(reply()->rawHeaderList().contains("ETag"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user