Compare commits

...

1 Commits

Author SHA1 Message Date
Dylan Conway
5307dbd53c maybe fix 2025-05-12 13:06:48 -07:00
2 changed files with 29 additions and 1 deletions

View File

@@ -803,7 +803,8 @@ const ServerPrototype = {
}
if (typeof optionalCallback === "function") setCloseCallback(this, optionalCallback);
this.listening = false;
server.stop();
server.stop(true);
return this;
},
[EventEmitter.captureRejectionSymbol]: function (err, event, ...args) {
switch (event) {

View File

@@ -0,0 +1,27 @@
'use strict';
const common = require('../common');
const http = require('http');
const { finished } = require('stream');
{
// Test abort before finished.
const server = http.createServer(function(req, res) {
res.write('asd');
});
server.listen(0, common.mustCall(function() {
http.request({
port: this.address().port
})
.on('response', (res) => {
res.on('readable', () => {
res.destroy();
});
finished(res, common.mustCall(() => {
server.close();
}));
})
.end();
}));
}