[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

@ -34,7 +34,8 @@ type DomainPermissionSubscription struct {
FetchPassword string `bun:",nullzero"` // Password to send when doing a GET of URI using basic auth.
FetchedAt time.Time `bun:"type:timestamptz,nullzero"` // Time when fetch of URI was last attempted.
SuccessfullyFetchedAt time.Time `bun:"type:timestamptz,nullzero"` // Time when the domain permission list was last *successfuly* fetched, to be transmitted as If-Modified-Since header.
ETag string `bun:"etag,nullzero"` // Etag last received from the server (if any) on successful fetch.
LastModified time.Time `bun:"type:timestamptz,nullzero"` // "Last-Modified" time received from the server (if any) on last successful fetch. Used for HTTP request caching.
ETag string `bun:"etag,nullzero"` // "ETag" header last received from the server (if any) on last successful fetch. Used for HTTP request caching.
Error string `bun:",nullzero"` // If latest fetch attempt errored, this field stores the error message. Cleared on latest successful fetch.
}