fix(uploads): bound the silence in an upload body with a re-armed read deadline (#56) (#63)
CI / Deploy via GitOps (push) Successful in 6s
CI / Lint / Test / Vet (push) Successful in 32s
CI / Build & Import (push) Successful in 11s

Closes #56

Co-authored-by: Mathias <mthbqv@gmail.com>
This commit was merged in pull request #63.
This commit is contained in:
2026-10-05 04:59:29 +00:00
committed by mathias
parent b9643f5fb7
commit 813e679f93
6 changed files with 243 additions and 5 deletions
+5
View File
@@ -125,6 +125,11 @@ type statusWriter struct {
wroteHeader bool
}
// Unwrap exposes the underlying writer to http.ResponseController, so a handler behind this
// middleware can still set a connection read deadline (#56: without it the upload idle bound
// was silently unavailable in production).
func (s *statusWriter) Unwrap() http.ResponseWriter { return s.ResponseWriter }
func (s *statusWriter) WriteHeader(code int) {
if !s.wroteHeader {
s.code = code