Skip to content

Commit 3f84b7e

Browse files
authored
fix: revert "fix: treat form-data bodies as binary" (#20343)
1 parent 05f9ad1 commit 3f84b7e

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

packages/net-stubbing/lib/server/util.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,6 @@ export function getBodyEncoding (req: CyHttpMessages.IncomingRequest): BodyEncod
251251
if (contentType.includes('charset=utf-8') || contentType.includes('charset="utf-8"')) {
252252
return 'utf8'
253253
}
254-
255-
if (contentType.includes('multipart/form-data')) {
256-
return 'binary'
257-
}
258254
}
259255

260256
// with fallback to inspecting the buffer using

packages/net-stubbing/test/unit/util-spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,5 @@ describe('net-stubbing util', () => {
6969

7070
expect(getBodyEncoding(req), 'image').to.equal('binary')
7171
})
72-
73-
it('returns binary for form-data bodies', () => {
74-
const formDataRequest = {
75-
body: Buffer.from('hello world'),
76-
headers: {
77-
'content-type': 'multipart/form-data',
78-
},
79-
method: 'POST',
80-
url: 'somewhere',
81-
httpVersion: '1.1',
82-
}
83-
84-
expect(getBodyEncoding(formDataRequest)).to.equal('binary')
85-
})
8672
})
8773
})

0 commit comments

Comments
 (0)