fastify / fastify/help

Fastify-multipart filebody loops itself

Open
#735 6 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
No language data
Stars
68
Forks
8
Avg merge
11h 2m
Merged PRs (30d)
2

Description

## 💬 Question here

Is it on purpose that when you get a file from a multipart file body that it creates a loop in itself?

```js
import {fastify as f} from "fastify"
import multipart from "@fastify/multipart"

const fastify = f()

fastify.register(multipart)

fastify.post('/', async function (req, reply) {
const data = await req.file()

console.log(data)

reply.send()
})

fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
````

![grafik](https://user-images.githubusercontent.com/45440100/184504303-df490c8c-9455-4c3b-a0ab-c14cd10fa2f4.png)
![grafik](https://user-images.githubusercontent.com/45440100/184504309-ac871ce3-ef3e-466d-a8d7-d80d756f4321.png)

## Your Environment

- *node version*: 16.10
- *fastify version*: 4.3.0 | @fastify/multipart: 7.1.0
- *os*: Any

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.