Skip to content

Commit

Permalink
http2: fix linting after rebase
Browse files Browse the repository at this point in the history
Backport-PR-URL: #14813
Backport-Reviewed-By: Anna Henningsen <[email protected]>
Backport-Reviewed-By: Timothy Gu <[email protected]>

PR-URL: #14239
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
jasnell authored and addaleax committed Aug 14, 2017
1 parent efd929e commit 6a30448
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
14 changes: 7 additions & 7 deletions test/parallel/test-http2-create-client-secure-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 8 additions & 8 deletions test/parallel/test-http2-getpackedsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(() => {
Expand Down

0 comments on commit 6a30448

Please sign in to comment.