Find direct PDF from page URL if Content-Type includes invalid parameter

The 'application/pdf' Content-Type shouldn't have any parameters, but a
site was returning 'application/pdf;charset=ISO-8859-1', so instead just
look for the 'application/pdf' prefix.
This commit is contained in:
Dan Stillman 2018-12-11 16:02:57 -05:00
parent 368e225ab8
commit 9ed8bed778

View file

@ -1762,7 +1762,7 @@ Zotero.Attachments = new function(){
}
// If DOI resolves directly to a PDF, save it to disk
if (contentType == 'application/pdf') {
if (contentType.startsWith('application/pdf')) {
Zotero.debug("URL resolves directly to PDF");
await Zotero.File.putContentsAsync(path, blob);
await _enforcePDF(path);