node-fetch/node-fetch

abort and correct the error message when `body.formData()` fails

Open

#1.509 geöffnet am 19. Feb. 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (8.563 Stars) (1.061 Forks)batch import
bughelp wanted

Beschreibung

Reproduction

Steps to reproduce the behavior:

  1. 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

Contributor Guide