Zotero does not send the ezproxy cookie when making request to a different proxied domain
Based on my read of the debug logs, if the URL for an attachment is from a different subdomain than the webpage that was scraped, then Zotero will not send the ezproxy cookie, causing the request to fail. I am wondering if the team is willing to consider special handling for the ezproxy cookie (it's always identified by the key "ezproxy" and its domain can be additionally used in case a user is using two different EZproxies).
I added this to doImport:
let jsonURL = "https://api.thirdiron.com/public/v1/libraries/61/articles/pmid/"
+ PMID + "?access_token=[...]";
ZU.doGet(jsonURL, function(jsonFile) {
// In case LibKey could not find any full text PDFs
try {
let article = JSON.parse(jsonFile);
let pdfURL = "https://api-thirdiron-com.proxy3.library.mcgill.ca/v2/libraries/61/articles/"
+ article.data.id + "/fullTextFile?access_token=[...]";
newItem.attachments.push({
title: "Full Text",
mimeType: "application/pdf",
url: pdfURL
});
}
catch (err) {
Z.debug("Encountered error: " + err);
}
}, null, null, null, false);
This might just work in Chrome or Firefox. Those browsers allow us to get full cookie information, including which domains to apply the cookie to. Safari doesn't, so we only send it to the primary URL (and it would be a security risk to send it elsewhere).