Skip to content

Commit

Permalink
Restore previous behavior to binary fixtures with no encoding specified
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueWinds committed Oct 25, 2021
1 parent 96aaac3 commit 5905fdf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/driver/src/cy/commands/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export default (Commands, Cypress, cy, state, config) => {
// `Buffer`, which webpack polyfills in the browser.
if (options.encoding === null) {
response = Buffer.from(response)
} else if (response instanceof ArrayBuffer) {
// Cypress' behavior is to base64 encode binary files if the user
// doesn't explicitly pass `null` as the encoding.
response = Buffer.from(response).toString('base64')
}

// add the fixture to the cache
Expand Down

0 comments on commit 5905fdf

Please sign in to comment.