-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
test: check zlib version for createDeflateRaw #13697
Changes from 4 commits
6db35e8
7e61bcf
a6365bf
b9833a1
aa525e4
1441b21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,15 @@ const assert = require('assert'); | |
const zlib = require('zlib'); | ||
|
||
// For raw deflate encoding, requests for 256-byte windows are rejected as | ||
// invalid by zlib. | ||
// (http://zlib.net/manual.html#Advanced) | ||
assert.throws(() => { | ||
zlib.createDeflateRaw({ windowBits: 8 }); | ||
}, /^Error: Init error$/); | ||
// invalid by zlib (http://zlib.net/manual.html#Advanced). | ||
// This check was introduced in vesion 1.2.9 and prior to that there was | ||
// no such rejection which is the reason for the version check below | ||
// (http://zlib.net/ChangeLog.txt). | ||
if ((/^(?!1\.2\.[0-8]$)/.test(process.versions.zlib))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn’t this equivalent to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was choosing between the both and had a trouble making up my mind. I'd be happy to change it. |
||
assert.throws(() => { | ||
zlib.createDeflateRaw({ windowBits: 8 }); | ||
}, /^Error: Init error$/); | ||
} | ||
|
||
// Regression tests for bugs in the validation logic. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix this.