GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — doc: fix misleading sentence in http.md by lpinca · Pull Request #26465 · nodejs/node Conversation
Member
Calling Fixes: #26005 Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
BridgeAR
previously approved these changes
ZYSzys
approved these changes
vsemozhetbyt
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional suggestion: Change the comma to a period and make the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
sam-github
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this leaves one case undescribed: Also, while accurate, so an improvement, I think its too low level, it doesn't give any idea why its done this way. And if you knew why, then you wouldn't need the docs. I'd suggest that the .write() docs be modified to say that because .write() can be called multiple times, the size of the entire response (or request, I suspect these docs apply to both req and response) cannot be known when .write() is called, so HTTP will use chunked transfer encoding, and there will not be a content-size header. In .end(), I'd say that if .write() has not previously been called, the total size is known (zero, or the size of the data arg), so node.js doesn't have to (and won't) use chunked transfer encoding, and it will write a content-length header. In other cases, since chunked transfer has already begun, any data provided to .end() will be transferred as a chunk. ^--- I think this is accurate, and describes why this is, and makes this seem less like a weird gotcha, and more like a feature: that if you have one large chunk that can be written in a single call to .end(), you can cause the content-size to be set and chunked mode not to be used. I'm not sure if it applies equally to the writing of requests, and the writing of responponses... but it should!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
|
nit: I think a commit message of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. Fixes: nodejs#26005
|
Folks that approved this, PTAL, I've updated as per @sam-github suggestion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I would rather have a detailed information but I won't block this either. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
It makes sense but I don't have the energy to update the docs as suggested in #26465 (comment) explaining how and when chunked mode is used, how to disable it, etc. especially due to all the nit picking that will come from that. If that is preferred I would prefer it to be done by a native speaker. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What should be done here? @jasnell PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. PR-URL: nodejs#26465 Fixes: nodejs#26005 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
|
Landed in 1706a2d 🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. PR-URL: #26465 Fixes: #26005 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. PR-URL: nodejs#26465 Fixes: nodejs#26005 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. PR-URL: #26465 Fixes: #26005 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
Calling `response.end(data)` is not 100% equivalent to calling `response.write(data)` followed by `response.end()`. PR-URL: #26465 Fixes: #26005 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
doc(http): res.write(data) followed by res.end() is not actually equivalent to res.end(data)
There was an error while loading. Please reload this page.