Closed
Description
- Version: node 8.12.0
- Platform: macOS Sierra 10.12.6 (16G1510)
- uname -a: Darwin [USERNAME] 16.7.0 Darwin Kernel Version 16.7.0: [DATETIME]; root:xnu-3789.73.14~1/RELEASE_X86_64 x86_64
- Subsystem: http
Example:
"use strict";
const http = require('http');
const options = {};
const server = http.createServer(options, (req, res) => {
console.log('got here', req, res);
});
server.listen(4000);
# telnet localhost 4000
GET /
Expected: Console.log of "got here"
Actual: No output.
It also doesn't work is options is set to:
const options = {
IncomingMessage: http.IncomingMessage,
ServerResponse: http.ServerResponse
}
Is working as expected in v10.13.0
Using node inspect
the difference in execution between v8 and v10 seems to be this line:
_http_common.js:117
return parser.onIncoming(parser.incoming, shouldKeepAlive);
Which should be returning a IncomingMessage object, but instead returns nothing. But that's as far as I could get with this.
Calling without the options object - i.e.:
const server = http.createServer((req, res) => {})
Works as expected
Activity