Skip to content

Commit

Permalink
Update proxy authentication URLs
Browse files Browse the repository at this point in the history
And try all, since it doesn't do any of this unless there's a PAC file,
it's not actually a network request unless the site should be proxied,
and it should only make a single HEAD request unless a previous one
fails.

There's a possibility some proxies are limited to HTTP, in which case
changing these to HTTPS might stop this from working. If so, we'd need
to add back HTTP addresses.

Closes zotero#1273
  • Loading branch information
dstillman committed Jul 29, 2017
1 parent ae22ce7 commit a6564e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions chrome/content/zotero/xpcom/http.js
Expand Up @@ -525,8 +525,7 @@ Zotero.HTTP = new function() {


/**
* Make a foreground HTTP request in order to trigger a proxy authentication
* dialog in Standalone
* Make a foreground HTTP request in order to trigger a proxy authentication dialog
*
* Other Zotero.HTTP requests are background requests by default, and
* background requests don't trigger a proxy auth prompt, so we make a
Expand All @@ -551,8 +550,7 @@ Zotero.HTTP = new function() {
uris.unshift(ZOTERO_CONFIG.PROXY_AUTH_URL);

return Zotero.spawn(function* () {
let max = 3; // how many URIs to try after the general Zotero one
for (let i = 0; i <= max; i++) {
for (let i = 0; i <= uris.length; i++) {
let uri = uris.shift();
if (!uri) {
break;
Expand Down Expand Up @@ -589,7 +587,7 @@ Zotero.HTTP = new function() {
let proxyInfo = yield _proxyAsyncResolve(uri);
if (proxyInfo) {
Zotero.debug("Proxy required for " + uri + " -- making HEAD request to trigger auth prompt");
yield Zotero.HTTP.promise("HEAD", uri, {
yield Zotero.HTTP.request("HEAD", uri, {
foreground: true,
dontCache: true
})
Expand Down
2 changes: 1 addition & 1 deletion defaults/preferences/zotero.js
Expand Up @@ -23,7 +23,7 @@ pref("extensions.zotero.automaticScraperUpdates",true);
pref("extensions.zotero.zoteroDotOrgVersionHeader", true);
pref("extensions.zotero.triggerProxyAuthentication", true);
// Proxy auth URLs should respond successfully to HEAD requests over HTTP and HTTPS (in case of forced HTTPS requests)
pref("extensions.zotero.proxyAuthenticationURLs", 'http://www.acm.org,http://www.ebscohost.com,http://www.elsevier.com,http://www.ieee.org,http://www.jstor.org,http://www.ovid.com,http://www.springer.com,http://www.tandfonline.com');
pref("extensions.zotero.proxyAuthenticationURLs", 'https://www.acm.org,https://www.ebscohost.com,https://www.sciencedirect.com,https://ieeexplore.ieee.org,https://www.jstor.org,http://www.ovid.com,https://link.springer.com,https://www.tandfonline.com');
pref("extensions.zotero.browserContentContextMenu", true);
pref("extensions.zotero.openURL.resolver","http://worldcatlibraries.org/registry/gateway");
pref("extensions.zotero.openURL.version","1.0");
Expand Down

0 comments on commit a6564e9

Please sign in to comment.