Title: Gzip decoder too strict · Issue #5761 · nodejs/node · GitHub
Open Graph Title: Gzip decoder too strict · Issue #5761 · nodejs/node
X Title: Gzip decoder too strict · Issue #5761 · nodejs/node
Description: Version: 5.9.0 Platform: Windows 7 64 bit Subsystem: zlib While talking to a web server on an embedded device, asking for gzip content encoding I get responses that are considered OK by all major browsers (Chrome, Firefox, IE) and also c...
Open Graph Description: Version: 5.9.0 Platform: Windows 7 64 bit Subsystem: zlib While talking to a web server on an embedded device, asking for gzip content encoding I get responses that are considered OK by all major b...
X Description: Version: 5.9.0 Platform: Windows 7 64 bit Subsystem: zlib While talking to a web server on an embedded device, asking for gzip content encoding I get responses that are considered OK by all major b...
Opengraph URL: https://github.com/nodejs/node/issues/5761
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Gzip decoder too strict","articleBody":"- **Version**: 5.9.0\n- **Platform**: Windows 7 64 bit\n- **Subsystem**: zlib\n\nWhile talking to a web server on an embedded device, asking for gzip content encoding I get responses that are considered OK by all major browsers (Chrome, Firefox, IE) and also cURL. However, the Node `zlib`module considers the gzip stream incomplete and throws an error. The error returned by the `zlib` module reads: `Error: unexpected end of file at Zlib._handle.onerror (zlib.js:363:17)`. Inspecting the gzip response it seems to be missing a footer detailing the CRC and the length of the compressed data.\n\nA small program that reproduces this with an actual response from the device in it:\n\n``` javascript\nvar buffer = require(\"buffer\");\nvar stream = require(\"stream\");\nvar fs = require(\"fs\");\nvar zlib = require(\"zlib\");\n\nvar s = new stream.Readable();\nvar b = new buffer.Buffer([\n 0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0xB2, 0xB1,\n 0xAF, 0xC8, 0xCD, 0x51, 0x28, 0x4B, 0x2D, 0x2A, 0xCE, 0xCC, 0xCF, 0xB3,\n 0x55, 0x32, 0xD4, 0x33, 0x50, 0x52, 0x48, 0xCD, 0x4B, 0xCE, 0x4F, 0xC9,\n 0xCC, 0x4B, 0xB7, 0x55, 0x2A, 0x2D, 0x49, 0xD3, 0xB5, 0x50, 0x52, 0xB0,\n 0xB7, 0xE3, 0xE5, 0xB2, 0x49, 0xCC, 0x49, 0x2C, 0xCA, 0x2D, 0x56, 0x48,\n 0x4E, 0x4C, 0xCE, 0x48, 0xCD, 0x4C, 0xB1, 0x55, 0xB2, 0x54, 0x52, 0x50,\n 0xD0, 0x07, 0x4A, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF\n]);\n\ns.push(b);\ns.push(null);\ns.pipe(zlib.createGunzip()).pipe(process.stdout);\n```\n\nWould it be possible to make the Node gzip decoder more lenient and behave more like all major browsers and cURL do?\n","author":{"url":"https://github.com/peterkooijmans","@type":"Person","name":"peterkooijmans"},"datePublished":"2016-03-17T16:31:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/5761/node/issues/5761"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9f54c301-6d25-46cc-fc90-e09a2caf3ebe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD46:E2378:16ABF6A:1F436D1:6A4EA4A7 |
| html-safe-nonce | 439d23f2ce224b150ebfcdb86e3ca067281873c6831ea722371d6b9a481e5f16 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDQ2OkUyMzc4OjE2QUJGNkE6MUY0MzZEMTo2QTRFQTRBNyIsInZpc2l0b3JfaWQiOiI4OTUyNTk2Nzc4OTQ0NzM0Mzc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 47fb2807ed639734c950bcd1db905678ae64cac8efcaf4e56d3ed2c6f93089a6 |
| hovercard-subject-tag | issue:141635701 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/5761/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f4bd64ef82f4493e7e479c7b6e12d95b6f23b98dc18967a3c2d2262a21b2d32/nodejs/node/issues/5761 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f4bd64ef82f4493e7e479c7b6e12d95b6f23b98dc18967a3c2d2262a21b2d32/nodejs/node/issues/5761 |
| og:image:alt | Version: 5.9.0 Platform: Windows 7 64 bit Subsystem: zlib While talking to a web server on an embedded device, asking for gzip content encoding I get responses that are considered OK by all major b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | peterkooijmans |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width