Skip to content

Incorrectly computes HTTP/2 client origin set #35356

Closed
@szmarczak

Description

@szmarczak
  • Version: 14.12.0
  • Platform: Linux solus 5.6.19-158.current #1 SMP PREEMPT Sun Jul 26 14:17:01 UTC 2020 x86_64 GNU/Linux
  • Subsystem: http2

What steps will reproduce the bug?

const http2 = require('http2');
const createCert = require('create-cert');

(async () => {
	const server = http2.createSecureServer({
		...(await createCert()),
		origins: [
			'https://example.com'
		]
	});

	server.listen(error => {
		if (error) {
			throw error;
		}

		const session = http2.connect(
			new URL('https://example.com'),
			{
				host: 'localhost',
				port: server.address().port,
				rejectUnauthorized: false
			}
		);

		session.once('remoteSettings', () => {
			console.log('remoteSettings', session.originSet);
		});

		session.once('origin', () => {
			console.log('origin', session.originSet);

			session.close();
			server.close();
		});
	});
})();

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

remoteSettings [ 'https://example.com' ]
origin [ 'https://example.com' ]

or throw if there's a mismatch between origin.port and options.port?

What do you see instead?

remoteSettings [ 'https://example.com:38303' ]
origin [ 'https://example.com:38303', 'https://example.com' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions