-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
server: send response to client with res.end() #1043
server: send response to client with res.end() #1043
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this configurable since this is a breaking change?
OK, I'll make this configurable. However, I want your suggestion on option name. Also, if I add an option, I have to edit the README too, right? |
yes
maybe |
So, server option |
That works |
d9ed4b5
to
01fb356
Compare
Using res.end() to write result instead of res.write() followed by res.end() will cause node not to use chunked encoding and include Content-Length header. (See nodejs/node#26005) This small distinction is important with some client. For example, Windows 10's MDM enrollment system will not accept chunked response (https://docs.microsoft.com/en-us/windows/client-management/mdm/on-premise-authentication-device-enrollment). This might improve compatibility with some other clients, too. However, there's a small chance that some client may expect the response to be chunked. So, I put this behind an option which defaults to enabled and can be disabled if needed.
01fb356
to
20390f2
Compare
thanks @peat-psuwit ! |
Using res.end() to write result instead of res.write() followed by
res.end() will cause node not to use chunked encoding and include
Content-Length header. (See nodejs/node#26005) This small distinction is
important with some client. For example, Windows 10's MDM enrollment
system will not accept chunked response
(https://docs.microsoft.com/en-us/windows/client-management/mdm/on-premise-authentication-device-enrollment).
This might improve compatibility with some other clients, too. However,
there's a small chance that some client may expect the response to be
chunked.