From fa2d43bd3efec57d5b17f0a2fa60e0d38ed0dad6 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 1 Apr 2018 08:52:10 +0200 Subject: [PATCH 1/4] url: make urlToOptions() handle IPv6 literals Strip the enclosing square brackets from the parsed hostname. PR-URL: https://github.com/nodejs/node/pull/19720 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- lib/internal/url.js | 4 +++- test/parallel/test-whatwg-url-properties.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index 1d5220df0b9..cff94e6b7d2 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1314,7 +1314,9 @@ function domainToUnicode(domain) { function urlToOptions(url) { var options = { protocol: url.protocol, - hostname: url.hostname, + hostname: url.hostname.startsWith('[') ? + url.hostname.slice(1, -1) : + url.hostname, hash: url.hash, search: url.search, pathname: url.pathname, diff --git a/test/parallel/test-whatwg-url-properties.js b/test/parallel/test-whatwg-url-properties.js index d6caae511ae..230315a70ef 100644 --- a/test/parallel/test-whatwg-url-properties.js +++ b/test/parallel/test-whatwg-url-properties.js @@ -143,6 +143,9 @@ assert.strictEqual(url.searchParams, oldParams); assert.strictEqual(opts.pathname, '/aaa/zzz'); assert.strictEqual(opts.search, '?l=24'); assert.strictEqual(opts.hash, '#test'); + + const { hostname } = urlToOptions(new URL('http://[::1]:21')); + assert.strictEqual(hostname, '::1'); } // Test special origins From 5e6817261c559390f8a6736fb33e7715f6dfbd16 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 10 Apr 2018 13:09:47 +0300 Subject: [PATCH 2/4] doc: prevent a false-positive linkification PR-URL: https://github.com/nodejs/node/pull/19913 Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca --- doc/api/zlib.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 0a554b40afe..f9967773e94 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -281,7 +281,7 @@ Compression strategy. * `zlib.constants.Z_FIXED` * `zlib.constants.Z_DEFAULT_STRATEGY` -## Class Options +## Class: Options -Creates and returns a new [Deflate][] object with the given [options][]. +Creates and returns a new [Deflate][] object with the given [`options`][]. ## zlib.createDeflateRaw([options]) -Creates and returns a new [DeflateRaw][] object with the given [options][]. +Creates and returns a new [DeflateRaw][] object with the given [`options`][]. An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when windowBits is set to 8 for raw deflate streams. zlib would automatically set windowBits @@ -494,35 +494,35 @@ that effectively uses an 8-bit window only. added: v0.5.8 --> -Creates and returns a new [Gunzip][] object with the given [options][]. +Creates and returns a new [Gunzip][] object with the given [`options`][]. ## zlib.createGzip([options]) -Creates and returns a new [Gzip][] object with the given [options][]. +Creates and returns a new [Gzip][] object with the given [`options`][]. ## zlib.createInflate([options]) -Creates and returns a new [Inflate][] object with the given [options][]. +Creates and returns a new [Inflate][] object with the given [`options`][]. ## zlib.createInflateRaw([options]) -Creates and returns a new [InflateRaw][] object with the given [options][]. +Creates and returns a new [InflateRaw][] object with the given [`options`][]. ## zlib.createUnzip([options]) -Creates and returns a new [Unzip][] object with the given [options][]. +Creates and returns a new [Unzip][] object with the given [`options`][]. ## Convenience Methods @@ -771,6 +771,7 @@ Decompress a chunk of data with [Unzip][]. [`Content-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 [`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView [`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray +[`options`]: #zlib_class_options [DeflateRaw]: #zlib_class_zlib_deflateraw [Deflate]: #zlib_class_zlib_deflate [Gunzip]: #zlib_class_zlib_gunzip @@ -778,7 +779,6 @@ Decompress a chunk of data with [Unzip][]. [InflateRaw]: #zlib_class_zlib_inflateraw [Inflate]: #zlib_class_zlib_inflate [Memory Usage Tuning]: #zlib_memory_usage_tuning -[options]: #zlib_class_options [Unzip]: #zlib_class_zlib_unzip [`UV_THREADPOOL_SIZE`]: cli.html#cli_uv_threadpool_size_size [`zlib.bytesWritten`]: #zlib_zlib_byteswritten From 8170f4f4631739290c92cf8ab37cd625371123f0 Mon Sep 17 00:00:00 2001 From: Jesse Gorzinski Date: Wed, 28 Mar 2018 20:47:14 -0500 Subject: [PATCH 3/4] build: add support for IBM i platform PR-URL: https://github.com/nodejs/node/pull/19667 Reviewed-By: Gireesh Punathil Reviewed-By: Ben Noordhuis Reviewed-By: Michael Dawson Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- common.gypi | 16 ++++++++++++++++ node.gyp | 10 +++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 7953404fae8..65ba80a15d2 100644 --- a/common.gypi +++ b/common.gypi @@ -94,8 +94,17 @@ 'msvs_configuration_platform': 'x64', }], ['OS=="aix"', { + 'variables': {'real_os_name': ' Date: Sun, 8 Apr 2018 22:54:24 -0400 Subject: [PATCH 4/4] test: verify inspector help url works This commit adds basic functionality testing of the help URL printed when the inspector starts. PR-URL: https://github.com/nodejs/node/pull/19887 Refs: https://github.com/nodejs/node/pull/19871 Reviewed-By: Rich Trott Reviewed-By: Richard Lau Reviewed-By: Khaidi Chu Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- test/internet/test-inspector-help-page.js | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/internet/test-inspector-help-page.js diff --git a/test/internet/test-inspector-help-page.js b/test/internet/test-inspector-help-page.js new file mode 100644 index 00000000000..a6a38bd0265 --- /dev/null +++ b/test/internet/test-inspector-help-page.js @@ -0,0 +1,37 @@ +'use strict'; +const common = require('../common'); + +common.skipIfInspectorDisabled(); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const https = require('https'); +const { spawnSync } = require('child_process'); +const child = spawnSync(process.execPath, ['--inspect', '-e', '""']); +const stderr = child.stderr.toString(); +const helpUrl = stderr.match(/For help, see: (.+)/)[1]; + +function check(url, cb) { + https.get(url, common.mustCall((res) => { + assert(res.statusCode >= 200 && res.statusCode < 400); + + if (res.statusCode >= 300) + return check(res.headers.location, cb); + + let result = ''; + + res.setEncoding('utf8'); + res.on('data', (data) => { + result += data; + }); + + res.on('end', common.mustCall(() => { + assert(/>Debugging Guide