sweep: fix missing view_count on HTML views, API expiry bounds, search ignoring custom slug (#33)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user