From fc8da5f8cde015d87e580a46b3f447b31e794373 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 23 Aug 2011 03:38:53 +0000 Subject: [PATCH] Don't auto-associate domains if an HTTP error code is received --- chrome/content/zotero/xpcom/proxy.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js index be253d8ff..f00ff4be1 100644 --- a/chrome/content/zotero/xpcom/proxy.js +++ b/chrome/content/zotero/xpcom/proxy.js @@ -94,8 +94,12 @@ Zotero.Proxies = new function() { if(m) { var host = m[proxy.parameters.indexOf("%h")+1]; // add this host if we know a proxy - if(proxy.autoAssociate && !Zotero.Proxies.hosts[host] && proxy.hosts.indexOf(host) == -1 && !_isBlacklisted(host)) { - // if no saved host and host is not blacklisted, auto associate + if(proxy.autoAssociate // if autoAssociate is on + && channel.responseStatus < 400 // and query was successful + && !Zotero.Proxies.hosts[host] // and host is not saved + && proxy.hosts.indexOf(host) === -1 + && !_isBlacklisted(host) // and host is not blacklisted + ) { proxy.hosts.push(host); proxy.save(true);