Sunday, July 05, 2020

[NEW] node.js http2 hello world malformed request pseudo-headers

const http2 = require('http2');
const fs = require('fs');

const IP = 'public ip';
const PORT = 8080;
const PATH_TO_CERT = '/etc/ssl/cert.pem';
const PATH_TO_KEY = '/etc/ssl/private/key.key';

const server = http2.createSecureServer({
key: fs.readFileSync( PATH_TO_KEY ),
cert: fs.readFileSync( PATH_TO_CERT ),
});

server.listen( PORT, IP, () => console.log('Server running at ' + IP + ' port ' + PORT));
server.on('error', error => console.log(error));

server.on('stream', ( stream, headers ) => {

stream.on('error', error => console.log(error));
console.log(headers);

stream.respond({':status': 200});
stream.end('hello world');
});
Hello, can anyone reproduce this please?



OpenBSD 6.7 + syspatch

pkg_add node (v12.16.1)

run helloworld http2 code in source.txt on public IP.

open https://yourtestdomain:8080 in Chrome, new Edge

Check logged request headers created by node.js.

Second request for favicon.ico is always problematic.

FireFox seem to be working OK.

Under Windows on localhost, every browser seems to be OK.



Any ideas? Thank You very much.



Best regards,

Martin Ziebiker








__________ Information from ESET Mail Security, version of virus signature database 20431 (20191129) __________

The message was checked by ESET Mail Security.
http://www.eset.com

No comments:

Post a Comment