commit eac0c1a94dbc6d3d19b6d5440328b0a39a4661c8
parent 161949115777868a261e8dc52aa0def509584778
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 15 Sep 2008 09:48:27 +0000
- Remove overriding OPTIONS response to text/plain -- the problem is incorrect status codes generated by IIS that result in "No element found" errors
- Replace passwords in malformed XML messages when generating error reports
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js
@@ -903,7 +903,6 @@ Zotero.Utilities.HTTP = new function() {
xmlhttp.onreadystatechange = function() {
_stateChange(xmlhttp, callback);
};
- xmlhttp.overrideMimeType("text/plain");
xmlhttp.send(null);
return xmlhttp;
}
@@ -973,7 +972,6 @@ Zotero.Utilities.HTTP = new function() {
};
xmlhttp.send(body);
-
return xmlhttp;
}
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -598,8 +598,17 @@ var Zotero = new function(){
}
}
+ // Remove password in malformed XML messages
+ if (msg.category == 'malformed-xml') {
+ try {
+ // msg.message is read-only, so store separately
+ var altMessage = msg.message.replace(/(file: "https?:\/\/[^:]+:)([^@]+)(@[^"]+")/, "$1********$3");
+ }
+ catch (e) {}
+ }
+
if (asStrings) {
- errors.push(msg.message)
+ errors.push(altMessage ? altMessage : msg.message)
}
else {
errors.push(msg);