Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix] Dont emit data from `req` in RoutingStream. This causes two `da…

…ta` events on piped requests with large bodies
  • Loading branch information...
commit b9b0a9309454088b82b7e1f0807f554c22d1c186 1 parent 9ed1c06
@indexzero indexzero authored
Showing with 1 addition and 6 deletions.
  1. +1 −1  lib/buffered-stream.js
  2. +0 −5 lib/routing-stream.js
View
2  lib/buffered-stream.js
@@ -76,7 +76,7 @@ BufferedStream.prototype.pipe = function () {
};
BufferedStream.prototype.write = function (chunk) {
- if (!this.chunks) {
+ if (!this.chunks || this.piped) {
this.emit('data', chunk);
return;
}
View
5 lib/routing-stream.js
@@ -56,11 +56,6 @@ RoutingStream.prototype.route = function (req) {
error,
i;
- // make sure data from req is piped on the `once` first call
- req.on('data', function () {
- self.emit.apply(self, ["data"].concat([].slice.call(arguments,0)));
- });
-
//
// Don't allow `this.target` to be writable on HEAD requests
//
Please sign in to comment.
Something went wrong with that request. Please try again.