Stabilize feature expiration.

This commit is contained in:
Catherine
2026-10-17 21:17:10 +00:00
parent 1f1c767f33
commit 90c98fbe71
2 changed files with 15 additions and 21 deletions
+2 -6
View File
@@ -45,12 +45,12 @@ func configureFeatures(ctx context.Context) (err error) {
for _, feature := range config.Features {
switch feature {
// Work-in-progress features:
case "preview", "expiration":
case "preview":
// Permanently unstable features:
case "codeberg-pages-compat", "relaxed-idna":
// Stabilized features:
case "archive-site", "audit", "compress", "patch", "serve-h2c", "existence-cache",
"absolute-headers":
"absolute-headers", "expiration":
logc.Printf(ctx, "feature %s has been stabilized", feature)
// Removed or renamed features:
case "h2c", "sentry-telemetry-buffer", "site-existence-cache", "domain-existence-cache":
@@ -754,10 +754,6 @@ func Main(versionInfo string) {
logc.Printf(ctx, "audit: expired %d records\n", count)
case *expireSites:
if !config.Feature("expiration") {
logc.Fatalf(ctx, "expire: feature disabled")
}
countExpired, countTransient := 0, 0
for item, err := range backend.GetAllManifests(ctx) {
metadata, manifest := item.Splat()
+13 -15
View File
@@ -518,22 +518,20 @@ func getUpdateOptions(
) (opts UpdateOptions, ok bool) {
var err error
if config.Feature("expiration") {
if expires := r.Header.Get("Expires"); expires != "" {
opts.expiresAt, err = time.Parse(http.TimeFormat, expires)
if err != nil {
http.Error(w, "malformed Expires: header", http.StatusBadRequest)
return
}
if !config.Limits.AllowExpiration {
http.Error(w, "expiration forbidden by policy", http.StatusBadRequest)
return
}
if expires := r.Header.Get("Expires"); expires != "" {
opts.expiresAt, err = time.Parse(http.TimeFormat, expires)
if err != nil {
http.Error(w, "malformed Expires: header", http.StatusBadRequest)
return
}
if !auth.expiresNoLater.IsZero() {
if opts.expiresAt.IsZero() || opts.expiresAt.After(auth.expiresNoLater) {
opts.expiresAt = auth.expiresNoLater
}
if !config.Limits.AllowExpiration {
http.Error(w, "expiration forbidden by policy", http.StatusBadRequest)
return
}
}
if !auth.expiresNoLater.IsZero() {
if opts.expiresAt.IsZero() || opts.expiresAt.After(auth.expiresNoLater) {
opts.expiresAt = auth.expiresNoLater
}
}