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 starts as true for HEAD requests from CURL #24283

Closed
ronag opened this issue Nov 10, 2018 · 4 comments
Closed

res.finished starts as true for HEAD requests from CURL #24283

ronag opened this issue Nov 10, 2018 · 4 comments
Labels
http2 Issues or PRs related to the http2 subsystem.

Comments

@ronag
Copy link
Member

ronag commented Nov 10, 2018

For some reason this fails... which is rather strange?

const assert = require('assert');
const http2 = require('http2');
const fixtures = require('../common/fixtures');

http2
  .createSecureServer({
    allowHTTP1: true,
    key: fixtures.readKey('agent1-key.pem'),
    cert: fixtures.readKey('agent1-cert.pem'),
    ca: fixtures.readKey('ca1-cert.pem')
  })
  .on('request', (req, res) => {
    assert.ok(!res.finished) // AssertionError
  })
  .listen(5001)
curl --head -k https://localhost:5001
@ronag
Copy link
Member Author

ronag commented Nov 10, 2018

Might be a http2 vs http discrepancy?

@Trott
Copy link
Member

Trott commented Nov 11, 2018

@nodejs/http2

@ronag
Copy link
Member Author

ronag commented Nov 11, 2018

It seems stream._writableState.ended is true for headRequest.

@targos targos added the http2 Issues or PRs related to the http2 subsystem. label Nov 11, 2018
ronag added a commit to nxtedition/node that referenced this issue Nov 14, 2018
http2 streams for HEAD requests are never writable,
thus writableState is not interesting for checking
whether a response is ended or aborted.

Refs: nodejs#24283
PR-URL: nodejs#24339
@ronag
Copy link
Member Author

ronag commented Jun 8, 2019

Duplicate #24743

@ronag ronag closed this as completed Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants