Skip to content

Commit

Permalink
Make extraction of ETag header independent of capitalisation.
Browse files Browse the repository at this point in the history
Fixes #7703.

Signed-off-by: Joshua Noeske <[email protected]>
  • Loading branch information
PatrickJosh committed Jan 5, 2025
1 parent 5af3c88 commit e9991d4
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 e9991d4

Please sign in to comment.