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>
This commit is contained in:
parent
7152790c85
commit
064ac2c666
@ -546,7 +546,7 @@ function setupHandle(session, socket, type, options) {
|
|||||||
session[kHandle] = handle;
|
session[kHandle] = handle;
|
||||||
|
|
||||||
const settings = typeof options.settings === 'object' ?
|
const settings = typeof options.settings === 'object' ?
|
||||||
options.settings : Object.create(null);
|
options.settings : Object.create(null);
|
||||||
|
|
||||||
session.settings(settings);
|
session.settings(settings);
|
||||||
process.nextTick(emit.bind(session, 'connect', session, socket));
|
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 =
|
||||||
statOptions.length < 0 ? stat.size - (+statOptions.offset) :
|
statOptions.length < 0 ? stat.size - (+statOptions.offset) :
|
||||||
Math.min(stat.size - (+statOptions.offset),
|
Math.min(stat.size - (+statOptions.offset),
|
||||||
statOptions.length);
|
statOptions.length);
|
||||||
|
|
||||||
if (headers[HTTP2_HEADER_CONTENT_LENGTH] === undefined)
|
if (headers[HTTP2_HEADER_CONTENT_LENGTH] === undefined)
|
||||||
headers[HTTP2_HEADER_CONTENT_LENGTH] = statOptions.length;
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = statOptions.length;
|
||||||
@ -1889,7 +1889,7 @@ class ServerHttp2Stream extends Http2Stream {
|
|||||||
if (options.length !== undefined && typeof options.length !== 'number')
|
if (options.length !== undefined && typeof options.length !== 'number')
|
||||||
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
||||||
'length',
|
'length',
|
||||||
options.length);
|
options.length);
|
||||||
|
|
||||||
if (options.statCheck !== undefined &&
|
if (options.statCheck !== undefined &&
|
||||||
typeof options.statCheck !== 'function') {
|
typeof options.statCheck !== 'function') {
|
||||||
@ -1970,7 +1970,7 @@ class ServerHttp2Stream extends Http2Stream {
|
|||||||
if (options.length !== undefined && typeof options.length !== 'number')
|
if (options.length !== undefined && typeof options.length !== 'number')
|
||||||
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
||||||
'length',
|
'length',
|
||||||
options.length);
|
options.length);
|
||||||
|
|
||||||
if (options.statCheck !== undefined &&
|
if (options.statCheck !== undefined &&
|
||||||
typeof options.statCheck !== 'function') {
|
typeof options.statCheck !== 'function') {
|
||||||
@ -2453,7 +2453,7 @@ function getPackedSettings(settings) {
|
|||||||
if (settings.enablePush !== undefined &&
|
if (settings.enablePush !== undefined &&
|
||||||
typeof settings.enablePush !== 'boolean') {
|
typeof settings.enablePush !== 'boolean') {
|
||||||
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
|
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
|
||||||
'enablePush', settings.enablePush);
|
'enablePush', settings.enablePush);
|
||||||
err.actual = settings.enablePush;
|
err.actual = settings.enablePush;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
@ -2516,7 +2516,7 @@ function getUnpackedSettings(buf, options = {}) {
|
|||||||
if (settings.enablePush !== undefined &&
|
if (settings.enablePush !== undefined &&
|
||||||
typeof settings.enablePush !== 'boolean') {
|
typeof settings.enablePush !== 'boolean') {
|
||||||
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
|
const err = new errors.TypeError('ERR_HTTP2_INVALID_SETTING_VALUE',
|
||||||
'enablePush', settings.enablePush);
|
'enablePush', settings.enablePush);
|
||||||
err.actual = settings.enablePush;
|
err.actual = settings.enablePush;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
@ -67,13 +67,13 @@ function verifySecureSession(key, cert, ca, opts) {
|
|||||||
|
|
||||||
// The server can be connected as 'localhost'.
|
// The server can be connected as 'localhost'.
|
||||||
verifySecureSession(
|
verifySecureSession(
|
||||||
loadKey('agent8-key.pem'),
|
loadKey('agent8-key.pem'),
|
||||||
loadKey('agent8-cert.pem'),
|
loadKey('agent8-cert.pem'),
|
||||||
loadKey('fake-startcom-root-cert.pem'));
|
loadKey('fake-startcom-root-cert.pem'));
|
||||||
|
|
||||||
// Custom servername is specified.
|
// Custom servername is specified.
|
||||||
verifySecureSession(
|
verifySecureSession(
|
||||||
loadKey('agent1-key.pem'),
|
loadKey('agent1-key.pem'),
|
||||||
loadKey('agent1-cert.pem'),
|
loadKey('agent1-cert.pem'),
|
||||||
loadKey('ca1-cert.pem'),
|
loadKey('ca1-cert.pem'),
|
||||||
{ servername: 'agent1' });
|
{ servername: 'agent1' });
|
||||||
|
@ -64,10 +64,10 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
|
|||||||
|
|
||||||
{
|
{
|
||||||
const check = Buffer.from([
|
const check = Buffer.from([
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
|
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
|
||||||
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
|
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
|
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
|
||||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
|
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
|
||||||
|
|
||||||
const packed = http2.getPackedSettings({
|
const packed = http2.getPackedSettings({
|
||||||
headerTableSize: 100,
|
headerTableSize: 100,
|
||||||
@ -84,10 +84,10 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
|
|||||||
|
|
||||||
{
|
{
|
||||||
const packed = Buffer.from([
|
const packed = Buffer.from([
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
|
0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x03, 0x00, 0x00,
|
||||||
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
|
0x00, 0xc8, 0x00, 0x05, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
|
0x00, 0x00, 0x00, 0x64, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64,
|
||||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
|
0x00, 0x02, 0x00, 0x00, 0x00, 0x01]);
|
||||||
|
|
||||||
[1, true, '', [], {}, NaN].forEach((i) => {
|
[1, true, '', [], {}, NaN].forEach((i) => {
|
||||||
assert.throws(() => {
|
assert.throws(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user