- Replace a strings.HasPrefix + strings.Cut with a call to strings.CutPrefix.
- Instead of enumerating all possible redirection code, check if the code is
300-something.
- Extract an error constructor outside of its current scope instead of
duplicating it 5 times
- Use constant strings for LocalizedError's return values where possible.
In general, duration is used as time unit representation.
At some places when int is returned, there's no documentation which unit is used.
So just convert to time.Duration ASAP.
As per the MDN article on HTTP caching:
During cache revalidation, if both If-Modified-Since and If-None-Match
are present, then If-None-Match takes precedence for the validator.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
Previously Miniflux would consider a resource unmodified if the
Last-Modified header had not changed, even if the ETag had changed.
With this commit, Miniflux will consider a resource modified if the ETag
header has changed, even if Last-Modified has not.
This fixes Bug 1 in https://rachelbythebay.com/w/2024/06/11/fsr/