Skip to content
Open
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
7 changes: 6 additions & 1 deletion lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ exports.XMLHttpRequest = function() {
* @param string header Header name
* @param string value Header value
*/
this.setRequestHeader = function(header, value) {
this.setRequestHeader = function(header, value, isReplace) {
var isReplaceTemp = false || isReplace;
if (this.readyState !== this.OPENED) {
throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");
}
Expand All @@ -202,6 +203,10 @@ exports.XMLHttpRequest = function() {
}
header = headersCase[header.toLowerCase()] || header;
headersCase[header.toLowerCase()] = header;
if (isReplaceTemp) {
headers[header] = value;
return;
}
headers[header] = headers[header] ? headers[header] + ', ' + value : value;
};

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "xmlhttprequest",
"name": "@aelfqueen/xmlhttprequest",
"description": "XMLHttpRequest for Node",
"version": "1.8.0",
"version": "1.8.1",
"author": {
"name": "Dan DeFelippi",
"url": "http://driverdan.com"
"name": "Dan DeFelippi, hzz780",
"url": "http://driverdan.com, https://github.com/hzz780/node-XMLHttpRequest"
},
"keywords": ["xhr", "ajax"],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/driverdan/node-XMLHttpRequest.git"
"url": "git://github.com/hzz780/node-XMLHttpRequest.git"
},
"browser": "./lib/browser.js",
"bugs": "http://github.com/driverdan/node-XMLHttpRequest/issues",
"bugs": "http://github.com/hzz780/node-XMLHttpRequest/issues",
"engines": {
"node": ">=0.4.0"
},
Expand Down