store: burn_after_reads>0 implies burn-after-read mode (#82)
CI / test (pull_request) Successful in 24s
CI / docker (pull_request) Skipped

This commit is contained in:
2026-09-09 18:28:00 -05:00
parent 69da340224
commit f37cc932c4
2 changed files with 33 additions and 2 deletions
+6 -2
View File
@@ -211,13 +211,17 @@ func (s *Store) CreatePaste(p *Paste) (*Paste, error) {
}
}
// #49: burn-after-read pastes carry a read budget (default 1 read)
if p.BurnAfterRead {
// #49/#82: burn-after-read pastes carry a read budget (default 1 read).
// burn_after_reads > 0 alone implies burn mode even without burn_after_read.
if p.BurnAfterRead || (p.BurnAfterReads != nil && *p.BurnAfterReads > 0) {
limit := int64(1)
if p.BurnAfterReads != nil && *p.BurnAfterReads > 0 {
limit = int64(*p.BurnAfterReads)
}
p.readsLimit = &limit
if !p.BurnAfterRead {
p.BurnAfterRead = true
}
}
visibility := p.Visibility