Browse Source

http2: fix linting after rebase

PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
v6
James M Snell 7 years ago
parent
commit
064ac2c666
  1. 14
      lib/internal/http2/core.js
  2. 14
      test/parallel/test-http2-create-client-secure-session.js
  3. 16
      test/parallel/test-http2-getpackedsettings.js

14
lib/internal/http2/core.js

@ -546,7 +546,7 @@ function setupHandle(session, socket, type, options) {
session[kHandle] = handle;
const settings = typeof options.settings === 'object' ?
options.settings : Object.create(null);
options.settings : Object.create(null);
session.settings(settings);
process.nextTick(emit.bind(session, 'connect', session, socket));
@ -1639,8 +1639,8 @@ function doSendFileFD(session, options, fd, headers, getTrailers, err, stat) {
statOptions.length =
statOptions.length < 0 ? stat.size - (+statOptions.offset) :
Math.min(stat.size - (+statOptions.offset),
statOptions.length);
Math.min(stat.size - (+statOptions.offset),
statOptions.length);
if (headers[HTTP2_HEADER_CONTENT_LENGTH] === undefined)
headers[HTTP2_HEADER_CONTENT_LENGTH] = statOptions.length;
@ -1889,7 +1889,7 @@ class ServerHttp2Stream extends Http2Stream {
if (options.length !== undefined && typeof options.length !== 'number')
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
'length',
options.length);
options.length);
if (options.statCheck !== undefined &&
typeof options.statCheck !== 'function') {
@ -1970,7 +1970,7 @@ class ServerHttp2Stream extends Http2Stream {
if (options.length !== undefined && typeof options.length !== 'number')
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
'length',
options.length);
options.length);
if (options.statCheck !== undefined &&
typeof options.statCheck !== 'function') {
@ -2453,7 +2453,7 @@ function getPackedSettings(settings) {
if (settings.enablePush !== undefined &&
typeof settings.enablePush !== 'boolean') {
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
'enablePush', settings.enablePush);
'enablePush', settings.enablePush);
err.actual = settings.enablePush;
throw err;
}
@ -2516,7 +2516,7 @@ function getUnpackedSettings(buf, options = {}) {
if (settings.enablePush !== undefined &&
typeof settings.enablePush !== 'boolean') {
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
'enablePush', settings.enablePush);
'enablePush', settings.enablePush);
err.actual = settings.enablePush;
throw err;
}

14
test/parallel/test-http2-create-client-secure-session.js

@ -67,13 +67,13 @@ function verifySecureSession(key, cert, ca, opts) {
// The server can be connected as 'localhost'.
verifySecureSession(
loadKey('agent8-key.pem'),
loadKey('agent8-cert.pem'),
loadKey('fake-startcom-root-cert.pem'));
loadKey('agent8-key.pem'),
loadKey('agent8-cert.pem'),
loadKey('fake-startcom-root-cert.pem'));
// Custom servername is specified.
verifySecureSession(
loadKey('agent1-key.pem'),
loadKey('agent1-cert.pem'),
loadKey('ca1-cert.pem'),
{ servername: 'agent1' });
loadKey('agent1-key.pem'),
loadKey('agent1-cert.pem'),
loadKey('ca1-cert.pem'),
{ servername: 'agent1' });

16
test/parallel/test-http2-getpackedsettings.js

@ -64,10 +64,10 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
{
const check = Buffer.from([
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
const packed = http2.getPackedSettings({
headerTableSize: 100,
@ -84,10 +84,10 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
{
const packed = Buffer.from([
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
[1, true, '', [], {}, NaN].forEach((i) => {
assert.throws(() => {

Loading…
Cancel
Save