Socket
Socket
Sign inDemoInstall

@fastify/multipart

Package Overview
Dependencies
Maintainers
18
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/multipart - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

6

callback.md

@@ -17,3 +17,3 @@ # Callback-based API

fastify.register(require('fastify-multipart'))
fastify.register(require('@fastify/multipart'))

@@ -72,3 +72,3 @@ fastify.post('/', function (req, reply) {

```js
fastify.register(require('fastify-multipart'), {
fastify.register(require('@fastify/multipart'), {
limits: {

@@ -137,3 +137,3 @@ fieldNameSize: 100, // Max field name size in bytes

fastify.register(require('fastify-multipart'), options)
fastify.register(require('@fastify/multipart'), options)

@@ -140,0 +140,0 @@ fastify.post('/', function (req, reply) {

@@ -558,4 +558,4 @@ 'use strict'

module.exports = fp(fastifyMultipart, {
fastify: '>= 0.39.0',
name: 'fastify-multipart'
fastify: '4.x',
name: '@fastify/multipart'
})
{
"name": "@fastify/multipart",
"version": "6.0.0",
"version": "7.0.0",
"description": "Multipart plugin for Fastify",

@@ -28,3 +28,3 @@ "main": "index.js",

"eslint-plugin-typescript": "^0.14.0",
"fastify": "^3.24.1",
"fastify": "^4.0.0-rc.2",
"form-data": "^4.0.0",

@@ -31,0 +31,0 @@ "h2url": "^0.2.0",

@@ -1,5 +0,5 @@

# fastify-multipart
# @fastify/multipart
![CI](https://github.com/fastify/fastify-multipart/workflows/CI/badge.svg)
[![NPM version](https://img.shields.io/npm/v/fastify-multipart.svg?style=flat)](https://www.npmjs.com/package/fastify-multipart)
[![NPM version](https://img.shields.io/npm/v/@fastify/multipart.svg?style=flat)](https://www.npmjs.com/package/@fastify/multipart)
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-multipart/badge.svg)](https://snyk.io/test/github/fastify/fastify-multipart)

@@ -21,3 +21,3 @@ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

```sh
npm i --save fastify-multipart
npm i --save @fastify/multipart
```

@@ -37,3 +37,3 @@

fastify.register(require('fastify-multipart'))
fastify.register(require('@fastify/multipart'))

@@ -75,3 +75,3 @@ fastify.post('/', async function (req, reply) {

**Note** about `data.fields`: `busboy` consumes the multipart in serial order (stream). Therefore, the order of form fields is *VERY IMPORTANT* to how `fastify-multipart` can display the fields to you.
**Note** about `data.fields`: `busboy` consumes the multipart in serial order (stream). Therefore, the order of form fields is *VERY IMPORTANT* to how `@fastify/multipart` can display the fields to you.
We would recommend you place the value fields first before any of the file fields.

@@ -84,3 +84,3 @@ It will ensure your fields are accessible before it starts consuming any files.

```js
fastify.register(require('fastify-multipart'), {
fastify.register(require('@fastify/multipart'), {
limits: {

@@ -233,3 +233,3 @@ fieldNameSize: 100, // Max field name size in bytes

```js
fastify.register(require('fastify-multipart'), { attachFieldsToBody: true })
fastify.register(require('@fastify/multipart'), { attachFieldsToBody: true })

@@ -252,3 +252,3 @@ fastify.post('/upload/files', async function (req, reply) {

fastify.register(require('fastify-multipart'), { attachFieldsToBody: true, onFile })
fastify.register(require('@fastify/multipart'), { attachFieldsToBody: true, onFile })

@@ -273,3 +273,3 @@ fastify.post('/upload/files', async function (req, reply) {

}
fastify.register(require('fastify-multipart'), opts)
fastify.register(require('@fastify/multipart'), opts)

@@ -376,3 +376,3 @@ fastify.post('/upload/files', {

}
fastify.register(require('fastify-multipart'), opts)
fastify.register(require('@fastify/multipart'), opts)

@@ -413,3 +413,3 @@ fastify.post('/upload/files', {

We export all custom errors via a server decorator `fastify.multipartErrors`. This is useful if you want to react to specific errors. They are derived from [fastify-error](https://github.com/fastify/fastify-error) and include the correct `statusCode` property.
We export all custom errors via a server decorator `fastify.multipartErrors`. This is useful if you want to react to specific errors. They are derived from [@fastify/error](https://github.com/fastify/fastify-error) and include the correct `statusCode` property.

@@ -416,0 +416,0 @@ ```js

@@ -46,3 +46,3 @@ 'use strict'

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
const knownLength = 1024 * 1024 * 1024

@@ -49,0 +49,0 @@ let total = knownLength

@@ -31,3 +31,3 @@ 'use strict'

t.type(req.body.myFile[0].data, Buffer)
t.equal(req.body.myFile[0].data.toString('utf8').substr(0, 19), '# fastify-multipart')
t.equal(req.body.myFile[0].data.toString('utf8').substr(0, 20), '# @fastify/multipart')

@@ -37,3 +37,3 @@ reply.send('ok')

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -83,3 +83,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -157,3 +157,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -224,3 +224,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -274,3 +274,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -333,3 +333,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -392,3 +392,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -439,3 +439,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -511,3 +511,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -582,3 +582,3 @@ const form = new FormData()

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -641,3 +641,3 @@ // request

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -705,3 +705,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -744,3 +744,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
fastify.inject({

@@ -775,3 +775,3 @@ method: 'GET',

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -822,3 +822,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -825,0 +825,0 @@ const form = new FormData()

@@ -65,3 +65,3 @@ 'use strict'

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
const knownLength = 1024 * 1024 * 1024

@@ -68,0 +68,0 @@ let total = knownLength

@@ -53,3 +53,3 @@ 'use strict'

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -114,3 +114,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -177,3 +177,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -235,3 +235,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -273,3 +273,3 @@ const opts = {

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -314,3 +314,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -362,3 +362,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -407,3 +407,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -461,3 +461,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -516,3 +516,3 @@ const form = new FormData()

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -519,0 +519,0 @@ const form = new FormData()

'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,5 +10,3 @@ const FormData = require('form-data')

const fs = require('fs')
const stream = require('stream')
const { once } = require('events')
const pump = util.promisify(stream.pipeline)

@@ -41,3 +38,3 @@ const filePath = path.join(__dirname, '../README.md')

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -58,9 +55,4 @@ // request

form.append('hello', 'world')
form.pipe(req)
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
const [res] = await once(req, 'response')

@@ -101,3 +93,3 @@ t.equal(res.statusCode, 200)

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -118,9 +110,4 @@ // request

form.append('hello', 'world')
form.pipe(req)
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
const [res] = await once(req, 'response')

@@ -145,3 +132,3 @@ t.equal(res.statusCode, 200)

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
const opts = {

@@ -148,0 +135,0 @@ protocol: 'http:',

'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,4 +10,2 @@ const FormData = require('form-data')

const { Readable } = require('readable-stream')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)
const sendToWormhole = require('stream-wormhole')

@@ -38,3 +35,3 @@ const EventEmitter = require('events')

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -81,3 +78,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -84,0 +81,0 @@ try {

'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,4 +10,2 @@ const FormData = require('form-data')

const fs = require('fs')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)

@@ -51,3 +48,3 @@ const filePath = path.join(__dirname, '../README.md')

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -73,8 +70,3 @@ const form = new FormData()

form.append('hello', 'world')
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -98,2 +90,3 @@ })

hello: {
type: 'object',
properties: {

@@ -114,3 +107,3 @@ value: {

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -135,9 +128,4 @@ const form = new FormData()

form.append('hello', 'world')
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})
})
'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,4 +10,2 @@ const FormData = require('form-data')

const fs = require('fs')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)

@@ -39,3 +36,3 @@ const filePath = path.join(__dirname, '../README.md')

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -60,8 +57,3 @@ const form = new FormData()

form.append('upload', fs.createReadStream(filePath))
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -94,3 +86,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -115,9 +107,4 @@ const form = new FormData()

form.append('upload', fs.createReadStream(filePath))
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})
})
'use strict'
const util = require('util')
const test = require('tap').test

@@ -15,6 +14,4 @@ const FormData = require('form-data')

const rimraf = require('rimraf')
const stream = require('stream')
const EventEmitter = require('events')
const { once } = EventEmitter
const pump = util.promisify(stream.pipeline)

@@ -60,3 +57,3 @@ const filePath = path.join(__dirname, '../README.md')

await fastify.listen(0)
await fastify.listen({ port: 0 })
// request

@@ -76,3 +73,3 @@ const form = new FormData()

pump(form, req)
form.pipe(req)

@@ -115,3 +112,3 @@ const [res] = await once(req, 'response')

await fastify.listen(0)
await fastify.listen({ port: 0 })
// request

@@ -138,3 +135,3 @@ const form = new FormData()

try {
await pump(form, req)
await form.pipe(req)
} catch (error) {

@@ -167,3 +164,3 @@ t.error(error, 'formData request pump: no err')

await fastify.listen(0)
await fastify.listen({ port: 0 })
// request

@@ -182,3 +179,3 @@ const form = new FormData()

pump(form, req)
form.pipe(req)

@@ -214,3 +211,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -231,3 +228,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -267,3 +264,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -284,3 +281,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -319,3 +316,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -362,3 +359,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -405,3 +402,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -430,3 +427,3 @@ async function send () {

try {
await pump(form, req)
await form.pipe(req)
} catch (error) {

@@ -457,3 +454,3 @@ t.error(error, 'formData request pump: no err')

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -480,3 +477,3 @@ const form = new FormData()

pump(form, req)
form.pipe(req)

@@ -483,0 +480,0 @@ const [res] = await once(req, 'response')

'use strict'
const util = require('util')
const crypto = require('crypto')

@@ -10,4 +9,2 @@ const test = require('tap').test

const http = require('http')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)
const EventEmitter = require('events')

@@ -44,3 +41,3 @@ const { once } = EventEmitter

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -50,4 +47,3 @@ // request

const opts = {
protocol: 'http:',
hostname: 'localhost',
hostname: '127.0.0.1',
port: fastify.server.address().port,

@@ -65,3 +61,3 @@ path: '/',

pump(form, req)
form.pipe(req)

@@ -108,3 +104,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -128,3 +124,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -135,3 +131,2 @@ try {

res.resume()
await once(res, 'end')
} catch (error) {

@@ -138,0 +133,0 @@ t.error(error, 'request')

@@ -29,3 +29,3 @@ 'use strict'

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
const url = `http://localhost:${fastify.server.address().port}`

@@ -32,0 +32,0 @@ const form = new FormData()

@@ -38,3 +38,3 @@ 'use strict'

await fastify.listen(0)
await fastify.listen({ port: 0 })
const dataSize = 1024 * 6

@@ -41,0 +41,0 @@ // request

'use strict'
const util = require('util')
const test = require('tap').test

@@ -9,4 +8,2 @@ const FormData = require('form-data')

const http = require('http')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)

@@ -31,3 +28,3 @@ test('should parse JSON fields forms if content-type is set', function (t) {

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -53,8 +50,3 @@ const form = new FormData()

form.append('json', JSON.stringify({ a: 'b' }), { contentType: 'application/json' })
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -81,3 +73,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -104,7 +96,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -134,3 +122,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -156,8 +144,3 @@ const form = new FormData()

form.append('object', 'INVALID', { contentType: 'application/json' })
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -187,3 +170,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -209,8 +192,3 @@ const form = new FormData()

form.append('object', JSON.stringify({ a: 'b' }), { contentType: 'application/json' })
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -236,3 +214,6 @@ })

field: {
allOf: [{ $ref: '#mySharedSchema' }, { properties: { value: { type: 'string' } } }]
allOf: [{ $ref: '#mySharedSchema' }, {
type: 'object',
properties: { value: { type: 'string' } }
}]
}

@@ -253,3 +234,3 @@ }

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -275,8 +256,3 @@ const form = new FormData()

form.append('field', JSON.stringify({ a: 'b' }))
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -302,3 +278,3 @@ })

field: {
allOf: [{ $ref: '#mySharedSchema' }, { properties: { value: { type: 'object' } } }]
allOf: [{ $ref: '#mySharedSchema' }, { type: 'object', properties: { value: { type: 'object' } } }]
}

@@ -319,3 +295,3 @@ }

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -341,8 +317,3 @@ const form = new FormData()

form.append('field', JSON.stringify({ a: 'b' }), { contentType: 'application/json' })
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -368,3 +339,3 @@ })

field: {
allOf: [{ $ref: '#mySharedSchema' }, { properties: { value: { type: 'object' } } }]
allOf: [{ $ref: '#mySharedSchema' }, { type: 'object', properties: { value: { type: 'object' } } }]
}

@@ -381,3 +352,3 @@ }

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -403,9 +374,4 @@ const form = new FormData()

form.append('field', JSON.stringify('abc'), { contentType: 'application/json' })
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})
})
'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,4 +10,2 @@ const FormData = require('form-data')

const fs = require('fs')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)

@@ -37,3 +34,3 @@ const filePath = path.join(__dirname, '../README.md')

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -60,7 +57,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -89,3 +82,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -111,8 +104,4 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})
})
'use strict'
const util = require('util')
const test = require('tap').test

@@ -11,4 +10,2 @@ const FormData = require('form-data')

const fs = require('fs')
const stream = require('stream')
const pump = util.promisify(stream.pipeline)
const EventEmitter = require('events')

@@ -37,3 +34,3 @@ const sendToWormhole = require('stream-wormhole')

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -54,3 +51,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -84,3 +81,3 @@ try {

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -101,3 +98,3 @@ // request

pump(form, req)
form.pipe(req)

@@ -104,0 +101,0 @@ try {

@@ -49,3 +49,3 @@ 'use strict'

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -75,7 +75,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -101,3 +97,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -126,7 +122,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -160,3 +152,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -187,7 +179,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -216,3 +204,3 @@ })

fastify.listen(0, function () {
fastify.listen({ port: 0 }, function () {
// request

@@ -257,3 +245,3 @@ const opts = {

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -276,7 +264,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -307,3 +291,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -329,8 +313,3 @@ const form = new FormData()

form.append('upload2', fs.createReadStream(filePath))
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -361,3 +340,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -412,3 +391,3 @@ const form = new FormData()

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -435,7 +414,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -464,3 +439,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -487,7 +462,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -518,3 +489,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -540,7 +511,3 @@ const form = new FormData()

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -566,3 +533,3 @@ })

fastify.listen(0, async function () {
fastify.listen({ port: 0 }, async function () {
// request

@@ -587,8 +554,3 @@ const form = new FormData()

form.append('upload2', fs.createReadStream(filePath))
try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)
})

@@ -642,3 +604,3 @@ })

await fastify.listen(0)
await fastify.listen({ port: 0 })

@@ -662,7 +624,3 @@ // request

try {
await pump(form, req)
} catch (error) {
t.error(error, 'formData request pump: no err')
}
form.pipe(req)

@@ -669,0 +627,0 @@ const [res] = await once(req, 'response')

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc