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 <git@joshuanoeske.de>
  • Loading branch information
PatrickJosh authored and mgallien committed Jan 7, 2025
1 parent 9a0c501 commit 80b6d0e
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 80b6d0e

Please sign in to comment.