From 31e9c86a0af21a4fed5cd18ad28ef55e99c43dc8 Mon Sep 17 00:00:00 2001 From: Gabriel Farrell Date: Mon, 23 Jun 2014 19:26:14 -0400 Subject: [PATCH] No default withCredentials. Updated version of #47 --- lib/request.js | 6 +----- test/request_url.js | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/request.js b/lib/request.js index d871a63..5151a6c 100644 --- a/lib/request.js +++ b/lib/request.js @@ -15,11 +15,7 @@ var Request = module.exports = function (xhr, params) { + (params.path || '/') ; - if (typeof params.withCredentials === 'undefined') { - params.withCredentials = true; - } - - try { xhr.withCredentials = params.withCredentials } + if (params.withCredentials) try { xhr.withCredentials = params.withCredentials } catch (e) {} if (params.responseType) try { xhr.responseType = params.responseType } diff --git a/test/request_url.js b/test/request_url.js index e622419..4d1f9ce 100644 --- a/test/request_url.js +++ b/test/request_url.js @@ -67,8 +67,5 @@ test('Test withCredentials param', function(t) { 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(); });