fix: revert "fix: treat form-data bodies as binary" (#20343)

This commit is contained in:
Zach Bloomquist
2022-02-23 15:42:28 -05:00
committed by GitHub
parent 05f9ad163e
commit 3f84b7ed42
2 changed files with 0 additions and 18 deletions
-4
View File
@@ -251,10 +251,6 @@ export function getBodyEncoding (req: CyHttpMessages.IncomingRequest): BodyEncod
if (contentType.includes('charset=utf-8') || contentType.includes('charset="utf-8"')) {
return 'utf8'
}
if (contentType.includes('multipart/form-data')) {
return 'binary'
}
}
// with fallback to inspecting the buffer using
@@ -69,19 +69,5 @@ describe('net-stubbing util', () => {
expect(getBodyEncoding(req), 'image').to.equal('binary')
})
it('returns binary for form-data bodies', () => {
const formDataRequest = {
body: Buffer.from('hello world'),
headers: {
'content-type': 'multipart/form-data',
},
method: 'POST',
url: 'somewhere',
httpVersion: '1.1',
}
expect(getBodyEncoding(formDataRequest)).to.equal('binary')
})
})
})