This commit is contained in:
Martin Rotter 2024-03-08 09:43:08 +01:00
parent 35b378d8b1
commit 3a97d5880c
2 changed files with 10 additions and 0 deletions

View File

@ -153,6 +153,8 @@
#define CLI_THREADS "threads"
#define HTTP_CODE_NOT_MODIFIED 304
#define HTTP_HEADERS_ACCEPT "Accept"
#define HTTP_HEADERS_CONTENT_TYPE "Content-Type"
#define HTTP_HEADERS_CONTENT_LENGTH "Content-Length"

View File

@ -238,6 +238,14 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
}
else {
f->setLastEtag(network_result.m_headers.value(QSL("etag")));
if (network_result.m_httpCode == HTTP_CODE_NOT_MODIFIED && feed_contents.trimmed().isEmpty()) {
// We very likely used "eTag" before and server reports that
// content was not modified since.
qWarningNN << LOGSEC_CORE << QUOTE_W_SPACE(feed->source())
<< "reported HTTP/304, meaning that the remote file did not change since last time we checked it.";
return {};
}
}
}
else if (f->sourceType() == StandardFeed::SourceType::EmbeddedBrowser) {