Compare commits

...

5 Commits

Author SHA1 Message Date
John Hiesey 0f81836459 v1.1.0 2015-07-12 21:10:55 -07:00
John Hiesey 73f1e6f3f0 Stop emitting 'close'
1. This fixes an issue where the `response` module emits an extra
  'end'
2. Node doesn't seem to emit 'close', even if "Connection: close"
  is specified
3. There isn't a real socket, and this module already doesn't
  emit the other socket-related events (and this is documented)
2015-07-12 21:08:00 -07:00
John Hiesey d700e6d8d9 Fix withCredentials flag for fetch implementation 2015-07-12 20:41:20 -07:00
John Hiesey 7cb4e22c9f v1.0.2 2015-07-12 18:46:15 -07:00
John Hiesey 9cb2a8db15 Don't test on ios 5.0 since saucelabs is removing it 2015-07-12 18:45:38 -07:00
4 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ browsers:
- name: opera
version: 11..latest
- name: iphone
version: 5.0..latest
version: 5.1..latest
- name: android
version: 4.0..latest
server: ./test/server/index.js
+1 -1
View File
@@ -109,7 +109,7 @@ ClientRequest.prototype._onFinish = function () {
headers: headers,
body: body,
mode: 'cors',
credentials: opts.credentials ? 'include' : 'omit'
credentials: opts.withCredentials ? 'include' : 'omit'
}).then(function (response) {
self._fetchResponse = response
self._connect()
-3
View File
@@ -39,7 +39,6 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
reader.read().then(function (result) {
if (result.done) {
self.push(null)
self.emit('close')
return
}
self.push(new Buffer(result.value))
@@ -151,7 +150,6 @@ IncomingMessage.prototype._onXHRProgress = function () {
}
reader.onload = function () {
self.push(null)
self.emit('close')
}
// reader.onerror = ??? // TODO: this
reader.readAsArrayBuffer(response)
@@ -161,6 +159,5 @@ IncomingMessage.prototype._onXHRProgress = function () {
// The ms-stream case handles end separately in reader.onload()
if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') {
self.push(null)
self.emit('close')
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "stream-http",
"version": "1.0.1",
"version": "1.1.0",
"description": "Streaming http in the browser",
"main": "index.js",
"repository": {