feat(ingest): batch event writes and harden transport
This commit is contained in:
@@ -38,6 +38,7 @@ func main() {
|
||||
})
|
||||
|
||||
r.Post("/v1/events", func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Body = http.MaxBytesReader(w, r.Body, 10<<20) // 10MB limit
|
||||
var events []json.RawMessage
|
||||
if err := json.NewDecoder(r.Body).Decode(&events); err != nil {
|
||||
httpx.WriteJSON(w, http.StatusBadRequest, map[string]any{"error": "invalid_json"})
|
||||
|
||||
Reference in New Issue
Block a user