request body sent in separate SSL segment (bug at 9.6.0)

  • Version: bug introduced in 9.6.0 and still present on 12.1.0
  • Platform: Linux 4.4.0-142-generic Release Cycle Proposal #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: http / https (maybe tls)
  • Minor bug.

The code:

let req = https.request("https://example.org")
req.end( Buffer.from("hello\n") );

For Node >= 9.6.0, sends two SSL segments (one with request + headers, the other with the body hello\n). Node <= 9.5.0 sends a single SSL segment with everything as expected.

If instead of passing a Buffer, we pass a string:

This works correctly in all Node.JS versions.