-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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: respondWithFile() does not set headersSent to true #18862
Comments
If it's ok, I want to try to fix this issue, I reproduce the bug on my machine. It will be my first code contribution here after few contributions on documentation. But I think I can find it. |
Sure @antoine-amara, I know the locations of the fixes, can guide you on how to fix it and which tests to update. |
Ok thanks, I remain available to code a fix. |
cc @nodejs/http2 |
This is indeed a bug. @antoine-amara Would you be able to send a PR? |
Yes, I find the function to update, I write the code, tests and I will made a PR as soon as possible. Thanks 👍 |
@antoine-amara I think you can add an assertion to test/parallel/test-http2-respond-file.js. |
When using respondWithFile or respondWithFD the headersSent flags was never set to true. Fix it to set state.flags to STREAM_FLAGS_HEADERS_SENT after processing headers into these methods. Fixes: nodejs#18862
@antoine-amara open a PR and we will take a look! |
|
@apapirovski you are right! down the road Very likely #19070 can be closed then. I'm sorry @antoine-amara. |
That's ok , I'm junior and I'm a beginner into the open source world. That's a good experience for me. |
This was resolved. |
I came across this issue while writing unit tests for
stream.respond()
in PR #18861The method
respondWithFile()
does not setstate.flags
, thusheadersSent
is still set to false:node/lib/internal/http2/core.js
Lines 2267 to 2321 in 472cde6
This looks like a bug as both
respond()
andrespondWithFD()
setstate.flags
so thatheadersSent
is set to true.The text was updated successfully, but these errors were encountered: