sweep: fix missing view_count on HTML views, API expiry bounds, search ignoring custom slug (#33)
CI / test (push) Successful in 21s
CI / docker (push) Skipped

This commit is contained in:
2026-09-09 00:34:24 -05:00
parent cb23707125
commit 03600b2ed5
4 changed files with 139 additions and 1 deletions
+7
View File
@@ -237,6 +237,13 @@ func (a *apiServer) handlePasteView(w http.ResponseWriter, r *http.Request) {
// one-time display of the deletion token via the created banner
http.SetCookie(w, &http.Cookie{Name: "tok_" + row.ID, Value: token, Path: "/", MaxAge: 60, HttpOnly: true, SameSite: http.SameSiteLaxMode})
}
// Count the view for every real page render. Raw views increment in
// handleRaw; the HTML path was missing its increment, so view_count only
// ever moved via /raw and the API-stored count stayed at 0 (#33).
// The just-created banner render does not count as a view.
if !justCreated {
a.store.IncrementViews(row.ID)
}
// #49: burn-after-N-reads budget (per-viewer, 15-minute dedupe window).
// Just-created first render does not count as a read for the creator.
if !justCreated {