Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib: the gzip header#os is weird in macos #18273

Closed
yorkie opened this issue Jan 20, 2018 · 5 comments
Closed

zlib: the gzip header#os is weird in macos #18273

yorkie opened this issue Jan 20, 2018 · 5 comments
Labels
invalid Issues and PRs that are invalid. zlib Issues and PRs related to the zlib subsystem.

Comments

@yorkie
Copy link
Contributor

yorkie commented Jan 20, 2018

  • Version: v8.9.0+
  • Platform: macos
  • Subsystem: zlib

To reproduce, see the following source code:

var fs = require('fs');
var fstream = fs.createReadStream('some-file');
var gzip = new require('zlib').Gzip();
gzip.on('data', function(chunk) {
  console.log(chunk);
});
fstream.pipe(gzip);

It would output the gzip format header in first log as:

<Buffer 1f 8b 08 00 00 00 00 00 00 13>

In the GZIP RFC, the flag#13 is marked to "Acorn RISCOS", this might be not correct?

/cc @indutny

@yorkie
Copy link
Contributor Author

yorkie commented Jan 20, 2018

I used the zlib in the same machine to write a simple program outside of Node.js, the generated header is:

<Buffer 1f 8b 08 00 00 00 00 00 00 03>

The 03 means Unix system, it seems right than 13 :)

@yorkie yorkie changed the title zlib: the gzip header os flag is weird in macos zlib: the gzip header#os is weird in macos Jan 20, 2018
@bnoordhuis
Copy link
Member

Note that's 0x13, not 13 in decimal. 0x13 or 19 in decimal is zlib's identifier for macos >= 10. The "Macintosh" the RFC mentions is classic macos (macos <= 9).

@bnoordhuis bnoordhuis added invalid Issues and PRs that are invalid. zlib Issues and PRs related to the zlib subsystem. labels Jan 20, 2018
@yorkie
Copy link
Contributor Author

yorkie commented Jan 20, 2018

Sorry, my mistake :)

@bnoordhuis
Copy link
Member

No problem. :-)

@dennisvang
Copy link

Note that's 0x13, not 13 in decimal. 0x13 or 19 in decimal is zlib's identifier for macos >= 10. The "Macintosh" the RFC mentions is classic macos (macos <= 9).

@bnoordhuis Sorry to bother you regarding this old post, but would you happen to know of a reference for this? RFC 1952 does not mention 19 (decimal), and I've not been able to track down another source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid. zlib Issues and PRs related to the zlib subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants