simplify etag caching requests

This commit is contained in:
ITotalJustice
2024-12-30 02:27:52 +00:00
parent 7804bbbcbc
commit cdb38f27a7
6 changed files with 46 additions and 46 deletions

View File

@@ -210,10 +210,9 @@ auto DownloadAssetJson(ProgressBox* pbox, const std::string& url, GhApiEntry& ou
curl::Url{url},
curl::Path{path},
curl::OnProgress{pbox->OnDownloadProgressCallback()},
curl::Flags{curl::Flag_Cache},
curl::Header{
{ "Accept", "application/vnd.github+json" },
{ "if-none-match", curl::cache::etag_get(path) },
{ "if-modified-since", curl::cache::lmt_get(path) },
}
);
@@ -222,8 +221,6 @@ auto DownloadAssetJson(ProgressBox* pbox, const std::string& url, GhApiEntry& ou
return false;
}
curl::cache::etag_set(result.path, result.header);
curl::cache::lmt_set(result.path, result.header);
from_json(result.path, out);
}