Skip to content

Commit

Permalink
Merge pull request #7720 from PatrickJosh/master
Browse files Browse the repository at this point in the history
Make extraction of ETag header independent of capitalisation
  • Loading branch information
mgallien authored Jan 7, 2025
2 parents 9a0c501 + 80b6d0e commit dd888a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/gui/ocsjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ bool OcsJob::finished()

} else {
// save new ETag value
if(reply()->rawHeaderList().contains("ETag"))
emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode);
if (const auto etagHeader = reply()->header(QNetworkRequest::ETagHeader); etagHeader.isValid()) {
emit etagResponseHeaderReceived(etagHeader.toByteArray(), statusCode);
}

emit jobFinished(json, statusCode);
}
Expand Down
5 changes: 3 additions & 2 deletions src/libsync/networkjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,9 @@ bool JsonApiJob::finished()
}

// save new ETag value
if(reply()->rawHeaderList().contains("ETag"))
emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode);
if (const auto etagHeader = reply()->header(QNetworkRequest::ETagHeader); etagHeader.isValid()) {
emit etagResponseHeaderReceived(etagHeader.toByteArray(), statusCode);
}

QJsonParseError error{};
auto json = QJsonDocument::fromJson(jsonStr.toUtf8(), &error);
Expand Down

0 comments on commit dd888a1

Please sign in to comment.