Don't show nsIChannel passwords in debug output
This commit is contained in:
parent
a3205de571
commit
0b82266882
|
@ -13,6 +13,19 @@ Zotero.HTTP = new function() {
|
|||
this.xmlhttp = xmlhttp;
|
||||
this.status = xmlhttp.status;
|
||||
this.message = msg;
|
||||
|
||||
// Hide password from debug output
|
||||
//
|
||||
// Password also shows up in channel.name (nsIRequest.name), but that's
|
||||
// read-only and has to be handled in Zotero.varDump()
|
||||
try {
|
||||
if (xmlhttp.channel.URI.password) {
|
||||
xmlhttp.channel.URI.password = "********";
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug(e, 1);
|
||||
}
|
||||
};
|
||||
|
||||
this.UnexpectedStatusException.prototype.toString = function() {
|
||||
|
|
|
@ -1136,6 +1136,9 @@ Zotero.Utilities = {
|
|||
}
|
||||
|
||||
if (typeof(arr) == 'object') { // Array/Hashes/Objects
|
||||
let isRequest = ((Zotero.isFx && !Zotero.isBookmarklet) || Zotero.isStandalone)
|
||||
&& arr instanceof Components.interfaces.nsIRequest;
|
||||
|
||||
//array for checking recursion
|
||||
//initialise at first itteration
|
||||
if(!parentObjects) {
|
||||
|
@ -1145,6 +1148,12 @@ Zotero.Utilities = {
|
|||
|
||||
for (var item in arr) {
|
||||
try {
|
||||
// Don't display nsIRequest.name, which can contain password
|
||||
if (isRequest && item == 'name') {
|
||||
dumped_text += level_padding + "'" + item + "' => <<Skipped>>\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = arr[item];
|
||||
} catch(e) {
|
||||
dumped_text += level_padding + "'" + item + "' => <<Access Denied>>\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user