Harden backup and restore operations

This commit is contained in:
Mikei386 committed 2026-07-13 19:47:43 +02:00
1 parent 6cbf170d65
commit bbf063c157
26 files changed
+914 -184

No files matched your search

+4
View File
@@ -301,6 +301,10 @@ func decode(r *http.Request, target any) error {
if err := decoder.Decode(target); err != nil {
return fmt.Errorf("validation: invalid JSON: %w", err)
}
var trailing any
if err := decoder.Decode(&trailing); !errors.Is(err, io.EOF) {
return errors.New("validation: JSON body must contain exactly one value and be at most 2 MiB")
}
return nil
}