From 6a9b372e66a38c4f46e9c6e5d9b30019eafe7e66 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 15 Nov 2008 16:35:02 +0000 Subject: [PATCH] Fixes #1204, Automatic proxy code gets stuck in a loop --- chrome/content/zotero/xpcom/proxy.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js index 2475f3a517..3ee4d839cb 100644 --- a/chrome/content/zotero/xpcom/proxy.js +++ b/chrome/content/zotero/xpcom/proxy.js @@ -130,7 +130,17 @@ Zotero.Proxies = new function() { if(webNav) { var proxied = this.properToProxy(url, true); - if(proxied) webNav.loadURI(proxied, 0, channel.URI, null, null); + if(proxied) { + channel.QueryInterface(Components.interfaces.nsIHttpChannel); + // If the referrer is a proxiable host, we already have access + // (e.g., we're on-campus) and shouldn't redirect + if (channel.referrer) { + if (this.properToProxy(channel.referrer.spec, true)) { + return; + } + } + webNav.loadURI(proxied, 0, channel.URI, null, null); + } } } }