nodules / asker

http.request wrapper with gzip, request retries and http.Agent tuning
MIT License
93 stars 11 forks source link

response with `content-length` less than actual response length leads to the two callback calls #46

Closed kaero closed 11 years ago

kaero commented 11 years ago

first time callback called with args:

error : {
  code: 905,
  message: 'http.clientRequest error for request %requestId% in 1~2 ms localhost:10089/',
  /*[Error: Parse Error]*/
  originalError: {
    bytesParsed: 110,
    code: 'HPE_INVALID_CONSTANT' 
  }
},
response : undefined

second time:

error : null,
response : { /* response object with data striped to content-length */ }