Skip to content

Commit

Permalink
Merge pull request #96 from kumavis/patch-1
Browse files Browse the repository at this point in the history
Expose xhr.withCredentials with correct default
  • Loading branch information
driverdan committed Oct 11, 2015
2 parents 65a970d + 0565aab commit 078626a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/XMLHttpRequest.js
Expand Up @@ -110,6 +110,10 @@ exports.XMLHttpRequest = function() {
this.responseXML = "";
this.status = null;
this.statusText = null;

// Whether cross-site Access-Control requests should be made using
// credentials such as cookies or authorization headers
this.withCredentials = false;

/**
* Private methods
Expand Down Expand Up @@ -364,7 +368,8 @@ exports.XMLHttpRequest = function() {
path: uri,
method: settings.method,
headers: headers,
agent: false
agent: false,
withCredentials: self.withCredentials
};

// Reset error flag
Expand Down Expand Up @@ -400,7 +405,8 @@ exports.XMLHttpRequest = function() {
port: url.port,
path: url.path,
method: response.statusCode === 303 ? "GET" : settings.method,
headers: headers
headers: headers,
withCredentials: self.withCredentials
};

// Issue the new request
Expand Down

0 comments on commit 078626a

Please sign in to comment.