diff options
| author | 2025-01-20 09:56:00 +0000 | |
|---|---|---|
| committer | 2025-01-20 10:56:00 +0100 | |
| commit | 37fd7c7a6a991b03507a4a7d5235dad1d4e6a958 (patch) | |
| tree | 379ca9362cc322516a282306f39ab52f29f89d78 /internal/subscriptions/domainperms.go | |
| parent | [chore]: Bump github.com/gin-contrib/cors from 1.7.2 to 1.7.3 (#3661) (diff) | |
| download | gotosocial-37fd7c7a6a991b03507a4a7d5235dad1d4e6a958.tar.xz | |
[bugfix] Store LastModified for domain perm subs + send as If-Modified-Since (#3655)
Diffstat (limited to 'internal/subscriptions/domainperms.go')
| -rw-r--r-- | internal/subscriptions/domainperms.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/subscriptions/domainperms.go b/internal/subscriptions/domainperms.go index ee4730023..b94f284bf 100644 --- a/internal/subscriptions/domainperms.go +++ b/internal/subscriptions/domainperms.go @@ -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 |
