-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IncomingMessage is a Readable stream and should properly set the destroyed property. PR-URL: #33131 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
- Loading branch information
Showing
10 changed files
with
94 additions
and
4 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
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
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
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,41 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const http = require('http'); | ||
|
||
{ | ||
const server = http.createServer(common.mustCall((req, res) => { | ||
res.end('asd'); | ||
})); | ||
|
||
server.listen(0, common.mustCall(() => { | ||
http.get({ | ||
port: server.address().port | ||
}, common.mustCall((res) => { | ||
assert.strictEqual(res.destroyed, false); | ||
res.destroy(); | ||
assert.strictEqual(res.destroyed, true); | ||
res.on('close', common.mustCall(() => { | ||
server.close(); | ||
})); | ||
})); | ||
})); | ||
} | ||
|
||
{ | ||
const server = http.createServer(common.mustCall((req, res) => { | ||
res.end('asd'); | ||
})); | ||
|
||
server.listen(0, common.mustCall(() => { | ||
http.get({ | ||
port: server.address().port | ||
}, common.mustCall((res) => { | ||
assert.strictEqual(res.destroyed, false); | ||
res.on('close', common.mustCall(() => { | ||
assert.strictEqual(res.destroyed, true); | ||
server.close(); | ||
})).resume(); | ||
})); | ||
})); | ||
} |
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
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
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
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
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
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