node-fetch/node-fetch

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

Open

#1,509 创建于 2022年2月19日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (8,563 star) (1,061 fork)batch import
bughelp wanted

描述

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

贡献者指南

abort and correct the error message when `body.formData()` fails · node-fetch/node-fetch#1509 | Good First Issue