Skip to content

Commit

Permalink
pause and resume should act on response instead of request
Browse files Browse the repository at this point in the history
  • Loading branch information
tobowers committed May 12, 2011
1 parent 8bb7f98 commit 55a1fde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,12 @@ Request.prototype.end = function () {
this.req.end.apply(this.req, arguments);
}
Request.prototype.pause = function () {
if (!this.req) throw new Error("This request has been piped before http.request() was called.");
this.req.pause.apply(this.req, arguments);
if (!this.response) throw new Error("This request has been piped before http.request() was called.");
this.response.pause.apply(this.response, arguments);
}
Request.prototype.resume = function () {
if (!this.req) throw new Error("This request has been piped before http.request() was called.");
this.req.resume.apply(this.req, arguments);
if (!this.response) throw new Error("This request has been piped before http.request() was called.");
this.response.resume.apply(this.response, arguments);
}

function request (options, callback) {
Expand Down

0 comments on commit 55a1fde

Please sign in to comment.