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

http2 - headersSent internal? #15226

Closed
ronag opened this issue Sep 6, 2017 · 3 comments
Closed

http2 - headersSent internal? #15226

ronag opened this issue Sep 6, 2017 · 3 comments
Labels
http2 Issues or PRs related to the http2 subsystem.

Comments

@ronag
Copy link
Member

ronag commented Sep 6, 2017

      "type": "TypeError",
      "message": "Cannot read property 'headersSent' of undefined",
      "stack": "TypeError: Cannot read property 'headersSent' of undefined\n    at Http2ServerResponse.get headersSent [as headersSent] (internal/http2/compat.js:303:18)\n    at Http2SecureServer.httpServer (/Users/ronagy/GitHub/nxtedition/nxt-proxy/src/index.js:91:9)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)"
@apapirovski
Copy link
Contributor

apapirovski commented Sep 6, 2017

You're likely trying to access it after the stream was already destroyed.

@mcollina thoughts? This is a bit incompatible with h1 since there you could access it even after the 'finish' event fires whereas now we can't.

@mcollina
Copy link
Member

mcollina commented Sep 6, 2017

I think we should protect headerSent if the stream is destroyed. I'd assume they have been sent if the state is missing.

@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Sep 6, 2017
apapirovski added a commit to apapirovski/node that referenced this issue Sep 7, 2017
Store headersSent directly on response state after finish event
is triggered, so that users can always access it.

Fixes: nodejs#15226
@ronag ronag changed the title http2 headersSent internal? http2 - headersSent internal? Sep 8, 2017
MylesBorins pushed a commit that referenced this issue Sep 12, 2017
Store headersSent directly on response state after finish event
is triggered, so that users can always access it.

PR-URL: #15232
Fixes: #15226
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
addaleax pushed a commit to addaleax/node that referenced this issue Sep 13, 2017
Store headersSent directly on response state after finish event
is triggered, so that users can always access it.

PR-URL: nodejs#15232
Fixes: nodejs#15226
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@RahulBenzeen
Copy link

try to solve in various way but didn't help needed
image

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

Successfully merging a pull request may close this issue.

5 participants