Skip to content

FormData body is being coerced to JSON #50

Open
@illusionalsagacity

Description

@illusionalsagacity

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 in Request to be exactly false. This property doesn't appear to be used?
  • Check instanceof FormData from undici, I don't think this is a great option but it's an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions