fix(02): reject trailing JSON after the first decoded value (WR-03)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -130,6 +130,9 @@ func decodeJSON(raw []byte) (any, error) {
|
||||
if err := dec.Decode(&v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if dec.More() {
|
||||
return nil, fmt.Errorf("trailing JSON after first value")
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user