-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e3e148
commit ae668c1
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const http = require('http'); | ||
|
||
const server = http.createServer(function (req, res) { | ||
res.writeHead(200); | ||
res.end(); | ||
}); | ||
|
||
server.listen(0, common.mustCall(() => { | ||
const req = http.get({ port: server.address().port }, (res) => { | ||
assert.strictEqual(res.statusCode, 200); | ||
|
||
res.resume(); | ||
server.close(); | ||
}); | ||
|
||
req.end(); | ||
})); | ||
|
||
// This timer should never go off as the server will close the socket | ||
setTimeout(common.mustNotCall(), 1000).unref(); |