Fix User-Agent header handling for endpoints updated in b5bc18c7ed

This commit is contained in:
Dan Stillman 2016-12-05 03:05:11 -05:00
parent b5bc18c7ed
commit 302efb0854

View file

@ -355,8 +355,14 @@ Zotero.Server.Connector.SaveItem.prototype = {
}
}
var cookieSandbox = data["uri"] ? new Zotero.CookieSandbox(null, data["uri"],
data["detailedCookies"] ? "" : data["cookie"] || "", options.userAgent) : null;
var cookieSandbox = data.uri
? new Zotero.CookieSandbox(
null,
data.uri,
data.detailedCookies ? "" : data.cookie || "",
options.headers["User-Agent"]
)
: null;
if(cookieSandbox && data.detailedCookies) {
cookieSandbox.addCookiesFromHeader(data.detailedCookies);
}
@ -466,7 +472,9 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
filesEditable = true;
}
var cookieSandbox = new Zotero.CookieSandbox(null, data["url"], data["cookie"], options.userAgent);
var cookieSandbox = new Zotero.CookieSandbox(
null, data.url, data.cookie, options.headers["User-Agent"]
);
if (data.pdf && filesEditable) {
delete Zotero.Server.Connector.Data[data.url];