Skip to content

Commit

Permalink
fix: revert "fix: treat form-data bodies as binary" (#20343)
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Feb 23, 2022
1 parent 05f9ad1 commit 3f84b7e
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')
})
})
})

2 comments on commit 3f84b7e

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 3f84b7e Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/9.5.1/linux-x64/circle-develop-3f84b7ed4239cb11b5c230482702151904e63aef/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 3f84b7e Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/9.5.1/win32-x64/circle-develop-3f84b7ed4239cb11b5c230482702151904e63aef/cypress.tgz

Please sign in to comment.