Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

res.finished doesn't work when using h2 protocol #276

Closed
SpaceK33z opened this issue Sep 19, 2016 · 2 comments
Closed

res.finished doesn't work when using h2 protocol #276

SpaceK33z opened this issue Sep 19, 2016 · 2 comments

Comments

@SpaceK33z
Copy link

SpaceK33z commented Sep 19, 2016

I've found an interesting issue. When using the h2 protocol, res.finished always returns false. Using http/1.1 as a protocol, this does work correctly.

Some sample code to reproduce:

var options = {
    spdy: {
        protocols: ['h2'],
        // Replace with this to see correct value:
        // protocols: ['http/1.1'],
    },
};

var server = spdy.createServer(options, function(req, res) {
    res.writeHead(200);
    res.end('hello world!');
    console.log('res finished:', res.finished);
});

server.listen(8080);

In this example, I would expect that the console outputs: res finished: true.

I wanted to try spdy with the sockjs-node package, but that doesn't work because of this issue. Took me a few hours to discover the root cause :).

Also see Node.js documentation about this.

@indutny
Copy link
Collaborator

indutny commented Sep 19, 2016

Fixed, sorry!

@SpaceK33z
Copy link
Author

Wow thanks for the quick fix!

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

No branches or pull requests

2 participants