   # set HTTP and/or HTTPS agent
   #
   # @param {Object} agents
-  # @option agents {Object} http the HTTP agent, defaults to {http.Agent}
-  # @option agents {Object} https the HTTPS agent, defaults to {https.Agent}
+  # @option agents {Object} http the HTTP agent, defaults to http.globalAgent
+  # @option agents {Object} https the HTTPS agent, defaults to https.globalAgent
   setAgents: (agents) ->
-    agents = agents or {}
     @_agents = {
-      http: agents.http or http.globalAgent,
-      https: agents.https or https.globalAgent
+      http: (agents and agents.http) or http.globalAgent,
+      https: (agents and agents.https) or https.globalAgent
     }
 
   # Sets the XHR's method, URL, synchronous flag, and authentication params.

  # @option options {Boolean} anon if true, the request's anonymous flag
  #   will be set
  # @option options {Object} agents user-provided HTTP & HTTPS agents
  # @option agents {Object} http the HTTP agent, defaults to {http.Agent}
  # @option agents {Object} https the HTTPS agent, defaults to {https.Agent}
  # @see http://www.w3.org/TR/XMLHttpRequest/#constructors
  # @see http://www.w3.org/TR/XMLHttpRequest/#anonymous-flag
  constructor: (options) ->

    @_totalBytes = 0
    @_lengthComputable = false

    @setAgents @_agents

  # @property {function(XMLHttpRequestProgressEvent)} DOM level 0-style handler
  #   for the 'readystatechange' event
