Skip to content

Commit

Permalink
NewsDownloader: add If-None-Match to headers
Browse files Browse the repository at this point in the history
Missing in koreader#13171.
  • Loading branch information
Frenzie committed Jan 31, 2025
1 parent 8b31f68 commit 5a9dc09
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/newsdownloader.koplugin/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,14 @@ function NewsDownloader:processFeedSource(url, credentials, limit, unsupported_f
local headers_cached = cached_response.headers
logger.dbg("NewsDownloader: Cached response headers", headers_cached)

local etag = headers_cached["etag"]
local last_modified = headers_cached["last-modified"]
if last_modified then
if etag or last_modified then
logger.dbg("NewsDownloader: sending If-Modified-Since", last_modified, url)
local response_body = {}
local headers = {
["If-Modified-Since"] = last_modified
["If-Modified-Since"] = last_modified,
["If-None-Match"] = etag,
}
if cookies then
headers["Cookie"] = cookies
Expand Down

0 comments on commit 5a9dc09

Please sign in to comment.