Skip to content

Commit

Permalink
Merge branch 'develop' into chore/beta-release-m1-support
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaSachs authored Feb 23, 2022
2 parents 139e8a2 + 3f84b7e commit 3d737f7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions packages/net-stubbing/lib/server/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions packages/net-stubbing/test/unit/util-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})

0 comments on commit 3d737f7

Please sign in to comment.