Fix User-Agent header handling for endpoints updated in b5bc18c7ed
This commit is contained in:
parent
b5bc18c7ed
commit
302efb0854
1 changed files with 11 additions and 3 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue