makeFeedRequest with GZIP throws Error: "incorrect header check"
See original GitHub issueRunning the document.getInfo(function(err, data) {})
function is resulting in an exception being thrown by browserfy-zlib. This can be traced back to the request from the makeFeedRequest()
function. makeFeedRequest
specifies gzip: true
in the request, which is causing the failure. Manually removing gzip:true
resultings in the api working as expected. Below is how i am utizliing the google-spreadsheets api.
I have a the following wrapper API to turn the callbacks into promises:
const GoogleSheetsAPI = () => {
return {
authorize: (sheetsId, credentials) => new Promise((resolve, reject) => {
if (typeof credentials == 'undefined') {
credentials = require(CREDENTIALS_PATH)
}
const doc = new GoogleSpreadsheet(sheetsId);
doc.useServiceAccountAuth(credentials, (err) => {
if (err) reject(err);
resolve(doc);
});
}),
load: (doc) => new Promise((resolve, reject) => {
console.log('getting doc info')
doc.getInfo(function(err, data) {
if (err) reject(err);
resolve(data);
});
})
}
}
`
And call this later by:
gsheetsAPI.authorize(sheetId);
.then(doc => gsheetsAPI.load(doc))
.then(data => {
//DO STUFF
})
.catch(err => console.log(err))
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Incorrect header check error - node.js - Stack Overflow
I am passing my own gzipped url in the code. Any help will be really useful. Thanks. node.js · http · request ·...
Read more >Incorrect header check - Questions - Kong Nation
I'm trying to send request throw postman and I'm getting the error incorrect header check, but if I send curl request I get...
Read more >3 while decompressing: incorrect header check - zlib.error
PYTHON : zlib. error : Error -3 while decompressing: incorrect header check [ Gift : Animated Search Engine ...
Read more >java.util.zip.ZipException: incorrect header check - JRDC2 B4J
zip, an exception will be thrown if the header is wrong. this usually means the stream was compressed using gzip,not zip. the stream...
Read more >Incorrect header check error when trying to use pako to ungzip ...
Because there are potentially tens of thousand of data points to optimize load times I'm compressing data using python gzip module. Since the ......
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 FreeTop 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
Top GitHub Comments
For anyone looking for how to get it to work: Initialize the doc like this
const doc = new GoogleSpreadsheet('<Spreadsheet ID>', null, { gzip: false })
Thanks a lot!, now it’s working fine !