mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
maybe fix
This commit is contained in:
@@ -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) {
|
||||
|
||||
27
test/js/node/test/parallel/test-http-client-finished.js
Normal file
27
test/js/node/test/parallel/test-http-client-finished.js
Normal 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();
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user