Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports.XMLHttpRequest = function() {
var self = this;
var http = require('http');
var https = require('https');
var withCredentials = true;

// Holds http.js objects
var request;
Expand Down Expand Up @@ -505,6 +506,11 @@ exports.XMLHttpRequest = function() {
}
};

this.withCredentials = function(state) {
withCredentials = state;
return withCredentials;
};

/**
* Called when an error is encountered to deal with it.
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/test-request-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function start(method) {
// Reset each time
xhr = new XMLHttpRequest();

var withCreds = xhr.withCredentials(false);
assert.equal(false, withCreds);

xhr.onreadystatechange = function() {
if (this.readyState == 4) {
if (method == "HEAD") {
Expand Down