forked from request/request
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Due to request#1568, we now propagate pause and resume to the response content stream, rather than the response stream. However, when pause is called before the response arrives, the pause is still being applied to the response object directly. Fix this by applying it to the response content stream in both cases. This avoids the issue that if pause is called on a gzip request before the response arrives, it pauses the response then resumes the response content, meaning the response can not be resumed. Also add tests of the pause/resume behavior for both the gzip and non-gzip case both before and after the response has arrived. This commit also makes the ancillary change that resume is now called unconditionally (when defined) in Redirect, since we always want to dump the response data (and it was previously called unconditionally in onRequestResponse). Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
- Loading branch information
Showing
5 changed files
with
139 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters