This uses the 'Age', 'Cache-Control' and 'Expires' HTTP headers to more
accurately set up the cache lifetime, falling back to a static 1-week
time if they're not present in the response.
Signed-off-by: flow <flowlnlnln@gmail.com>
This is to prevent problems where the cache entry would still be used
way after the remote resource got updated. The limit is hardcoded for 1
week, which I think is a reasonable time, but this could be further
tweaked.
Signed-off-by: flow <flowlnlnln@gmail.com>
This runs clang-tidy on some other files in launcher/net/.
This also makes use of some JSON wrappers in HttpMetaCache, instead of
using the Qt stuff directly.
Lastly, this removes useless null checks (crashes don't occur because of
this, but because of concurrent usage / free of the QByteArray pointer),
and fix a fixme in Download.h