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 (1,061 fork)batch import
bughelp wanted

仓库指标

Star
 (8,563 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南