Skip to content

Commit 2885361

Browse files
authored
Formdata tests (#4902)
1 parent 4991f3e commit 2885361

4 files changed

Lines changed: 1103 additions & 5 deletions

File tree

lib/web/fetch/formdata-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const { makeEntry } = require('./formdata')
66
const { webidl } = require('../webidl')
77
const assert = require('node:assert')
88
const { isomorphicDecode } = require('../infra')
9-
const { utf8DecodeBytes } = require('../../encoding')
109

1110
const dd = Buffer.from('--')
1211
const decoder = new TextDecoder()
12+
const decoderIgnoreBOM = new TextDecoder('utf-8', { ignoreBOM: true })
1313

1414
/**
1515
* @param {string} chars
@@ -188,7 +188,7 @@ function multipartFormDataParser (input, mimeType) {
188188
// 5.11. Otherwise:
189189

190190
// 5.11.1. Let value be the UTF-8 decoding without BOM of body.
191-
value = utf8DecodeBytes(Buffer.from(body))
191+
value = decoderIgnoreBOM.decode(Buffer.from(body))
192192
}
193193

194194
// 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.

0 commit comments

Comments
 (0)