Skip to content

Commit 31e9c86

Browse files
author
Gabriel Farrell
committed
No default withCredentials. Updated version of browserify#47
1 parent 7dc5009 commit 31e9c86

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lib/request.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ var Request = module.exports = function (xhr, params) {
1515
+ (params.path || '/')
1616
;
1717

18-
if (typeof params.withCredentials === 'undefined') {
19-
params.withCredentials = true;
20-
}
21-
22-
try { xhr.withCredentials = params.withCredentials }
18+
if (params.withCredentials) try { xhr.withCredentials = params.withCredentials }
2319
catch (e) {}
2420

2521
if (params.responseType) try { xhr.responseType = params.responseType }

test/request_url.js

-3
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,5 @@ test('Test withCredentials param', function(t) {
6767
var request = http.request({ url: url, withCredentials: true }, noop);
6868
t.equal( request.xhr.withCredentials, true, 'xhr.withCredentials should be true');
6969

70-
var request = http.request({ url: url }, noop);
71-
t.equal( request.xhr.withCredentials, true, 'xhr.withCredentials should be true');
72-
7370
t.end();
7471
});

0 commit comments

Comments
 (0)