http-browserify
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -18,3 +18,7 @@ var Stream = require('stream'); | ||
try { xhr.withCredentials = true } | ||
if (typeof params.withCredentials === 'undefined') { | ||
params.withCredentials = true; | ||
} | ||
try { xhr.withCredentials = params.withCredentials } | ||
catch (e) {} | ||
@@ -21,0 +25,0 @@ |
{ | ||
"name": "http-browserify", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "http module compatability for browserify", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,2 +59,17 @@ global.window = { | ||
}) | ||
}); | ||
test('Test withCredentials param', function(t) { | ||
var url = '/api/foo'; | ||
var request = http.request({ url: url, withCredentials: false }, noop); | ||
t.equal( request.xhr.withCredentials, false, 'xhr.withCredentials should be false'); | ||
var request = http.request({ url: url, withCredentials: true }, noop); | ||
t.equal( request.xhr.withCredentials, true, 'xhr.withCredentials should be true'); | ||
var request = http.request({ url: url }, noop); | ||
t.equal( request.xhr.withCredentials, true, 'xhr.withCredentials should be true'); | ||
t.end(); | ||
}); |
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
791261
11703
92360