-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
http: add flushHeaders and deprecate flush #1156
http: add flushHeaders and deprecate flush #1156
Conversation
req.setHeader('foo', 'bar'); | ||
req.flushHeaders(); | ||
}); | ||
|
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.
Tiny nit: blank line at EOF.
LGTM and seems like a reasonable change. @iojs/collaborators Opinions? |
LGTM. This actually seems more comprehensive than the original commit in joyent/node. |
@dougwilson I know I've seen flush around express before, how annoying is a deprecation like this? |
This change is probably better for Express, because we don't use this method directly (yet), but also our compression middleware actually adds a res.flush() method for users to flush the zlib buffer to the client. With this change, it means io.js users of compression can more easily access this feature, since we won't be stomping on the method any longer :) |
LGTM |
Wouldn't this be semver-major? |
Deprecations are only semver minor. See rule
Just making something as deprecated is not backwards-incompatible, as all code using a deprecation function works exactly the same. |
Ah, didn't see that |
LGTM |
PR-URL: #1156 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Christian Tellnes <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Thanks Yosuke, landed in b2e00e3. |
I found a different API from Node.js v0.12 and io.js.
the detail is here nodejs/node-v0.x-archive@89f3c90
http
module in io.js has a methodreq.flush
.Node.js v0.12 also has a same behavior method but the different name
req.flushHeaders
.the difference may cause to block migrations from Node.js v0.12 to io.js.
But if we rename
req.flush
toreq.flushHeaders
now, we should update the major version.So I add
req.flushHeaders
method and deprecatereq.flush
.If we bump the io.js master version, we would be better to rethink
req.flush
is removed.