Skip to content
Merged
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
10 changes: 8 additions & 2 deletions lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
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 @@ -363,7 +367,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 @@ -399,7 +404,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