Not handling some binary responses correctly (with reproduction)
See original GitHub issueDescription
Requests fail when fetching binary data.
The binary data seems to be fetching and recording fine. But then it is somehow wrong, because when passing gzip’ed data to the zlib, it complains that the data is not valid.
So the data is either transformed or cut off in some way.
Shareable Source
See https://github.com/moltar/polly-octet-stream
Error Message & Stack Trace
incorrect header check
Config
Using @spotify/polly-jest-presets
.
The config it ships with:
https://github.com/spotify/polly-jest-presets/blob/master/src/index.ts
Dependencies
From: https://github.com/spotify/polly-jest-presets/blob/master/package.json
Copy the @pollyjs dependencies from package.json
:
"dependencies": {
"@pollyjs/adapter-node-http": "^2.6.0",
"@pollyjs/core": "^2.6.0",
"@pollyjs/persister-fs": "^2.6.0",
"lodash.merge": "^4.6.2",
"setup-polly-jest": "^0.5.2"
}
"devDependencies": {
"@spotify/web-scripts": "^1.0.0",
"@types/lodash.merge": "^4.6.6",
"@types/pollyjs__adapter-node-http": "^2.0.0",
"@types/pollyjs__core": "^2.3.0",
"@types/pollyjs__persister-fs": "^2.0.0",
"moment": "^2.24.0"
}
Relevant Links
https://github.com/moltar/polly-octet-stream
Environment
Node.js v10.15.3
darwin 19.0.0
npm 6.13.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:16
Top Results From Across the Web
Not handling some binary responses correctly (with ... - GitHub
The binary data seems to be fetching and recording fine. ... Not handling some binary responses correctly (with reproduction) #278.
Read more >Bacterial binary fission | The cell cycle and mitosis (article)
Binary fission has features in common with mitosis, but also differs from mitosis in some important ways. Let's take a look at how...
Read more >24.1. Reproduction Methods – Concepts of Biology
Some unicellular eukaryotic organisms undergo binary fission by mitosis. In other organisms, part of the individual separates and forms a second individual.
Read more >OHIO GRADUATION TESTS
The student response does not meet the criteria required to earn one ... Asexual reproduction (binary fission) leads to offspring that are genetically ......
Read more >Science Test 1 Section 1 Flashcards - Quizlet
Asexual reproduction requires only one parent and produces non-identical offspring, while sexual reproduction requires two parents and produces identical ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Released with
v3.0.2
🎉Reproducible example:
Results in:
The error disappears when uncommenting the Polly.js block.
This is the best MWE I could find; the bug disappears without jest or node-fetch for me.