| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7589486 commit 6b380cc
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -369,8 +369,7 @@ function connectionListenerInternal(server, socket) { | |||
| 369 | 369 | ||
| 370 | 370 | // Ensure that the server property of the socket is correctly set. | |
| 371 | 371 | // See https://github.com/nodejs/node/issues/13435 | |
| 372 | - if (socket.server === null) | ||
| 373 | - socket.server = server; | ||
| 372 | + socket.server = server; | ||
| 374 | 373 | ||
| 375 | 374 | // If the user has added a listener to the server, | |
| 376 | 375 | // request, or response, then it's their responsibility. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,3 +138,17 @@ const MakeDuplexPair = require('../common/duplexpair'); | |||
| 138 | 138 | req.write(testData); | |
| 139 | 139 | req.end(); | |
| 140 | 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 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments