8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d257448 commit 1d1d136Copy full SHA for 1d1d136
lib/_http_server.js
@@ -365,8 +365,7 @@ function connectionListenerInternal(server, socket) {
365
366
// Ensure that the server property of the socket is correctly set.
367
// See https://github.com/nodejs/node/issues/13435
368
- if (socket.server === null)
369
- socket.server = server;
+ socket.server = server;
370
371
// If the user has added a listener to the server,
372
// request, or response, then it's their responsibility.
test/parallel/test-http-generic-streams.js
@@ -138,3 +138,17 @@ const MakeDuplexPair = require('../common/duplexpair');
138
req.write(testData);
139
req.end();
140
}
141
+
142
+// Test 5: The client sends garbage.
143
+{
144
+ const server = http.createServer(common.mustNotCall());
145
146
+ const { clientSide, serverSide } = MakeDuplexPair();
147
+ server.emit('connection', serverSide);
148
149
+ server.on('clientError', common.mustCall());
150
151
+ // Send something that is not an HTTP request.
152
+ clientSide.end(
153
+ 'I’m reading a book about anti-gravity. It’s impossible to put down!');
154
+}