Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: request/request
...
head fork: GotEmB/request
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 2 commit comments
  • 1 contributor
Commits on Aug 22, 2012
@GotEmB GotEmB Make endOnTick optional. bea4fa0
@GotEmB GotEmB Bugfix for previous commit.
Now checks for `options.endOnTick === null` instead of just `options.endOnTick` (It's a boolean that's either null or false!)
03a4232
Showing with 4 additions and 1 deletion.
  1. +4 −1 main.js
View
5 main.js
@@ -245,6 +245,8 @@ Request.prototype.init = function (options) {
if (options.aws) {
self.aws(options.aws)
}
+
+ self._endOnTick = options.endOnTick === null ? true : options.endOnTick;
if (self.uri.auth && !self.headers.authorization) {
self.headers.authorization = "Basic " + toBase64(self.uri.auth.split(':').map(function(item){ return qs.unescape(item)}).join(':'))
@@ -328,7 +330,7 @@ Request.prototype.init = function (options) {
self.agent.maxSockets = self.pool.maxSockets
}
}
-
+
self.once('pipe', function (src) {
if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.")
self.src = src
@@ -354,6 +356,7 @@ Request.prototype.init = function (options) {
})
process.nextTick(function () {
+ if (self._endOnTick === false) return
if (self._aborted) return
if (self.body) {

Showing you all comments on commits in this comparison.

@GotEmB

Cancel this function call if self._endOnTick is false.

@GotEmB

endOnTick is true by default. Explicitly set options.endOnTick = false to override the process.nextTick function call.

Something went wrong with that request. Please try again.