diff --git a/lib/request.js b/lib/request.js index 7c0a467..e1631a6 100644 --- a/lib/request.js +++ b/lib/request.js @@ -8,20 +8,15 @@ var Request = module.exports = function (xhr, params) { self.writable = true; self.xhr = xhr; self.body = []; - + self.uri = (params.scheme || 'http') + '://' + params.host + (params.port ? ':' + params.port : '') + (params.path || '/') ; - - if (typeof params.withCredentials === 'undefined') { - params.withCredentials = true; - } - try { xhr.withCredentials = params.withCredentials } - catch (e) {} - + xhr.withCredentials = params.withCredentials || false; + xhr.open( params.method || 'GET', self.uri, diff --git a/test/request_url.js b/test/request_url.js index e622419..6a0b896 100644 --- a/test/request_url.js +++ b/test/request_url.js @@ -68,7 +68,7 @@ test('Test withCredentials param', function(t) { 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.equal( request.xhr.withCredentials, false, 'xhr.withCredentials should be false'); t.end(); });