Skip to content

HTTP2 Push Stream always results in aborted event being fired #22851

Closed
@jgautier

Description

  • Version: v10.9.0
  • Platform: Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
  • Subsystem: HTTP2

Code sample:

const http2 = require('http2')
const server = http2.createServer()
server.on('stream', (stream, headers) => {
  stream.pushStream({ ':path': '/test' }, (err, pushStream) => {
    if (err) throw err
    pushStream.end('pushed some data')
  })
  stream.end('some data')
})
server.listen(8080, () => {
  let client = http2.connect('http://localhost:8080')
  let req = client.request({ ':path': '/' })
  req.on('data', (data) => {
    console.log(data.toString('utf8'))
  })
  client.on('stream', (pushedStream) => {
    console.log('on stream')
    pushedStream.on('aborted', () => {
      console.log('aborted')
    })
    pushedStream.on('end', () => {
      console.log('end')
    })
    pushedStream.on('data', (data) => {
      console.log(data.toString('utf8'))
    })
  })
})

Output:

on stream
some data
pushed some data
end
aborted

Expectation:

aborted event is not fired

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions