Comparing version 0.1.1 to 0.1.2
@@ -44,5 +44,13 @@ 'use strict'; | ||
this.offset = 0; | ||
this.id = Requests.requested++; | ||
this.id = ++Requests.requested; | ||
this.streaming = options.streaming; | ||
this.socket = Requests[Requests.method](options); | ||
// | ||
// Open the socket BEFORE adding any properties to the instance as this might | ||
// trigger a thrown `InvalidStateError: An attempt was made to use an object | ||
// that is not, or is no longer, usable` error in FireFox: | ||
// | ||
// @see https://bugzilla.mozilla.org/show_bug.cgi?id=707484 | ||
// | ||
this.socket.open(options.method.toUpperCase(), url, true); | ||
@@ -117,3 +125,3 @@ | ||
if (requests.streaming) { | ||
if ('string' === typeof options.body) { | ||
if (!options.body || 'string' === typeof options.body) { | ||
if ('multipart' in socket) { | ||
@@ -120,0 +128,0 @@ socket.multipart = true; |
{ | ||
"name": "requests", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "An XHR abstraction that works in browsers and node.js", | ||
@@ -9,6 +9,9 @@ "main": "index.js", | ||
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", | ||
"test": "mocha test/test.js", | ||
"watch": "mocha --watch test/test.js", | ||
"coverage": "istanbul cover ./node_modules/.bin/_mocha -- test/test.js", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test/test.js", | ||
"test": "node test/index.js", | ||
"static": "node test/static.js", | ||
"node": "mocha test/requests.test.js", | ||
"watch": "mocha --watch ./test/requests.test.js", | ||
"all": "npm run test && npm run node", | ||
"coverage": "istanbul cover ./node_modules/.bin/_mocha -- test/requests.test.js", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test/requests.test.js", | ||
"compile": "mkdir -p dist && browserify browser.js -o dist/requests.js --standalone Requests", | ||
@@ -45,7 +48,23 @@ "start": "node test/development.js" | ||
"assume": "1.2.x", | ||
"async-each": "0.1.x", | ||
"browserify": "8.x.x", | ||
"istanbul": "0.3.x", | ||
"mocha": "2.2.x", | ||
"mochify": "2.7.x", | ||
"pre-commit": "1.0.x" | ||
}, | ||
"testling": { | ||
"files": "test/*.browser.js", | ||
"harness": "mocha-bdd", | ||
"browsers": [ | ||
"ie/6..latest", | ||
"chrome/22..latest", | ||
"firefox/16..latest", | ||
"safari/latest", | ||
"opera/11.0..latest", | ||
"iphone/latest", | ||
"ipad/latest", | ||
"android-browser/latest" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22198
14
485
7
3
4