From eac0c1a94dbc6d3d19b6d5440328b0a39a4661c8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 15 Sep 2008 09:48:27 +0000 Subject: [PATCH] - 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 --- chrome/content/zotero/xpcom/utilities.js | 2 -- chrome/content/zotero/xpcom/zotero.js | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index fd7ec0684..7a537fce6 100644 --- 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 index b312bcd6b..224a00011 100644 --- 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);