balena-request
Advanced tools
Comparing version 11.4.0 to 11.4.1-klutchell-gzip-sync-flush-2ef127ad8ece877f6303fde7e9f3bd65749ac52b
@@ -113,4 +113,12 @@ "use strict"; | ||
if (!isBrowser && utils.isResponseCompressed(response)) { | ||
const { createGunzip } = require('zlib'); | ||
const gunzip = createGunzip(); | ||
const zlib = require('zlib'); | ||
// Be more lenient with decoding compressed responses, since (very rarely) | ||
// servers send slightly invalid gzip responses that are still accepted | ||
// by common browsers. | ||
// Always using Z_SYNC_FLUSH is what cURL does. | ||
var zlibOptions = { | ||
flush: zlib.constants.Z_SYNC_FLUSH, | ||
finishFlush: zlib.constants.Z_SYNC_FLUSH | ||
}; | ||
const gunzip = zlib.createGunzip(zlibOptions); | ||
// Uncompress after or before piping through progress | ||
@@ -117,0 +125,0 @@ // depending on the response length available to us |
@@ -7,2 +7,7 @@ # Change Log | ||
# v11.4.1 | ||
## (2021-08-27) | ||
* Allow more levient gzip decompression [Kyle Harding] | ||
# v11.4.0 | ||
@@ -9,0 +14,0 @@ ## (2021-03-12) |
@@ -129,5 +129,15 @@ /* | ||
if (!isBrowser && utils.isResponseCompressed(response)) { | ||
const { createGunzip } = require('zlib'); | ||
const gunzip = createGunzip(); | ||
const zlib = require('zlib'); | ||
// Be more lenient with decoding compressed responses, since (very rarely) | ||
// servers send slightly invalid gzip responses that are still accepted | ||
// by common browsers. | ||
// Always using Z_SYNC_FLUSH is what cURL does. | ||
var zlibOptions = { | ||
flush: zlib.constants.Z_SYNC_FLUSH, | ||
finishFlush: zlib.constants.Z_SYNC_FLUSH | ||
} | ||
const gunzip = zlib.createGunzip(zlibOptions); | ||
// Uncompress after or before piping through progress | ||
@@ -134,0 +144,0 @@ // depending on the response length available to us |
{ | ||
"name": "balena-request", | ||
"version": "11.4.0", | ||
"version": "11.4.1-klutchell-gzip-sync-flush-2ef127ad8ece877f6303fde7e9f3bd65749ac52b", | ||
"description": "Balena HTTP client", | ||
@@ -65,3 +65,6 @@ "main": "build/request.js", | ||
"balena-auth": "^4.0.0" | ||
}, | ||
"versionist": { | ||
"publishedAt": "2021-08-27T19:07:49.509Z" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173991
1900
1