Harden sessions, uploads, admin demotion, and HTTP timeouts.

Address PR review findings: renew session tokens on auth, sniff/re-encode avatars, serialize last-admin checks, bound server timeouts, rune-safe truncation, and TEST_DATABASE_URL-only integration tests.
This commit is contained in:
2026-08-22 07:24:39 -07:00
parent 247fb05281
commit afd2476f3c
11 changed files with 113 additions and 36 deletions
+8 -1
View File
@@ -29,7 +29,14 @@ func main() {
uploader := blob.FromEnv()
handler := newHandler(db, sessions, uploader)
run(&http.Server{Addr: listenAddr(), Handler: handler})
run(&http.Server{
Addr: listenAddr(),
Handler: handler,
ReadHeaderTimeout: 5 * time.Second,
ReadTimeout: 30 * time.Second,
WriteTimeout: 60 * time.Second,
IdleTimeout: 90 * time.Second,
})
}
func openDB() (*sql.DB, *store.SessionStore) {