-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.

Description
- Version: 6.8.0
- Platform: Linux laptop1 3.16.0-4-amd64 deps: update openssl to 1.0.1j #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux
In the example below an HTTP server doesn't read the the request body, but returns the response immediately. If the client sends large data (e.g. 10,000,000 bytes) ECONNRESET error is emitted at client-side but on small data (e.g. 1,000,000 bytes) the programs runs silently.
var crypto = require('crypto'),
http = require('http')
var port = 8080
var server = http.createServer((req, res) => {
res.end(crypto.randomBytes(10000))
})
server.listen(port, () => {
var req = http.request({
port: port,
method: 'post',
})
req.end(crypto.randomBytes(10000000)) // <- play this value, remove zeros, then add
})
I think the client still sends data after receiving the response. Thus the client violates HTTP request syntax and the connection gets reset. Is this the expected behavior? If so what's the correct way of handling this?
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.