[bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655)

This commit is contained in:
tobi 2025-01-20 09:56:00 +00:00 committed by GitHub
commit 37fd7c7a6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 377 additions and 42 deletions

View file

@ -253,13 +253,9 @@ func (s *Subscriptions) ProcessDomainPermissionSubscription(
// to indicate a successful fetch, and return.
if resp.Unmodified {
l.Debug("received 304 Not Modified from remote")
permSub.ETag = resp.ETag
permSub.LastModified = resp.LastModified
permSub.SuccessfullyFetchedAt = permSub.FetchedAt
if permSub.ETag == "" && resp.ETag != "" {
// We didn't have an ETag before but
// we have one now: probably the remote
// added ETag support in the meantime.
permSub.ETag = resp.ETag
}
return nil, nil
}
@ -308,6 +304,7 @@ func (s *Subscriptions) ProcessDomainPermissionSubscription(
// This can now be considered a successful fetch.
permSub.SuccessfullyFetchedAt = permSub.FetchedAt
permSub.ETag = resp.ETag
permSub.LastModified = resp.LastModified
permSub.Error = ""
// Keep track of which domain perms are