node-fetch/node-fetch
Auf GitHub ansehenabort and correct the error message when `body.formData()` fails
Open
#1.509 geöffnet am 19. Feb. 2022
bughelp wanted
Beschreibung
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