apollo-datasource-http
apollo-datasource-http copied to clipboard
FormData body is being coerced to JSON
on this line, the typeof request.body === 'object'
check returns true for FormData
from undici
and form-data
. Resulting in a body of "{}"
being sent, with content-type: application/json; charset=utf-8
I think there's a few potential solutions here:
- Check the
content-type
, and if it's set, do not attempt to coerce to JSON. - Check the
json
property inRequest
to be exactlyfalse
. This property doesn't appear to be used? - Check
instanceof FormData
fromundici
, I don't think this is a great option but it's an option.