check / check (push) Successful in 10s
A report the buffer refuses now returns 500 instead of a false `ok`. Reports reach disk later, so a failed disk write is still answered 200 and shows in the log, and at shutdown as a failed stop with a non-zero exit. An over-limit body returns 413; malformed JSON stays 400. A MaxBodyBytes middleware caps every route at 1 MiB; a route group can only lower that limit. The raw geo blob is no longer logged; client_id, timestamp and decode error text are cut to 128 bytes before logging. Panic recovery logs the panic value and stack through slog. Model: opus-5-5
14 lines
442 B
Go
14 lines
442 B
Go
package handlers
|
|
|
|
import "log/slog"
|
|
|
|
// MaxLoggedFieldBytes exposes the log bound to the external tests.
|
|
const MaxLoggedFieldBytes = maxLoggedFieldBytes
|
|
|
|
// NewForTest builds a Handlers around a report sink and logger,
|
|
// bypassing the fx graph so handler behaviour (including the
|
|
// storage failure path) is exercisable in unit tests.
|
|
func NewForTest(buf reportAppender, log *slog.Logger) *Handlers {
|
|
return &Handlers{buf: buf, log: log}
|
|
}
|