Skip to content

http: missing close after finish #27480

@ronag

Description

@ronag

Node 10.13

const http = require('http')
const send = require('send')

const server = http
  .createServer(async (req, res) => {
    send(req, '/Users/ronagy/Desktop/old/AFT2/Start_060918_40.mov')
      .on('error', err => console.error(err))
      .pipe(res)
      .on('error', err => console.error(err))
      .on('finish', () => console.log('finish'))
      .on('close', () => console.log('close'))
  })

server.listen(9000, () => {
  http.request({
    method: 'GET',
    hostname: '0.0.0.0',
    port: 9000
  }).on('response', res => {
    res.on('data', buf => {
      // drain
    })
  }).end()
})

Would expect it to print 'finish' and then 'close'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions