Do not send back saveSingleFile: true if saving a PDF snapshot. (#1950)

This commit is contained in:
fletcherhaz 2021-02-05 13:31:34 -07:00 committed by GitHub
parent 293bf07c03
commit 55acf9a0c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -1143,7 +1143,9 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
return 500; return 500;
} }
return [201, "application/json", JSON.stringify({ saveSingleFile: !data.skipSnapshot })]; return [201,
"application/json",
JSON.stringify({ saveSingleFile: !data.skipSnapshot && !data.pdf })];
}, },
/* /*

View file

@ -1359,7 +1359,7 @@ describe("Connector Server", function () {
}); });
}); });
await Zotero.HTTP.request( let response = await Zotero.HTTP.request(
'POST', 'POST',
connectorServerPath + "/connector/saveSnapshot", connectorServerPath + "/connector/saveSnapshot",
{ {
@ -1368,10 +1368,13 @@ describe("Connector Server", function () {
}, },
body: JSON.stringify({ body: JSON.stringify({
url: testServerPath + "/test.pdf", url: testServerPath + "/test.pdf",
pdf: true pdf: true,
singleFile: true
}) })
} }
); );
let json = JSON.parse(response.responseText);
assert.propertyVal(json, 'saveSingleFile', false);
var ids = await promise; var ids = await promise;