Open
Description
Right now there is no way to call Body#formData
on arbitrary user input without potentially causing an OOM. It would be great if we could constrain the formData
parser so it stops parsing if a body exceeds a certain size.
Example API:
const form = req.formData({ maxSize: 10_000_000 /* 10MB */ })
If the body size exceeds the max size, a QuotaExceededError
DOMException
should be thrown.
This might make sense for .text()
, .blob()
, .arrayBuffer()
, and .json()
also.