node-fetch/node-fetch
在 GitHub 查看abort and correct the error message when `body.formData()` fails
Open
#1,509 创建于 2022年2月19日
bughelp wanted
描述
Reproduction
Steps to reproduce the behavior:
res = new Response('foo=bar').formData()
Expected behavior
reject with TypeError: Failed to fetch
and then also abort the response/request.
Additional context for fixer
in body.js -> formdata() look at the content-type header, if it's null or not a multipart or a searchparam and then abort the request to not leave it hanging and reject with a type error