Check for application/pdf as a substring and not as a full string for Content-Type and metadata in order to determine downloaded file type

This commit is contained in:
Grégory Soutadé 2021-11-26 19:59:57 +01:00
parent 89a5408c2d
commit 1f6e0ecdc8
1 changed files with 5 additions and 1 deletions

View File

@ -599,9 +599,13 @@ namespace gourou
std::string rightsStr = item->getRights();
if (headers.count("Content-Type") && headers["Content-Type"] == "application/pdf")
if (item->getMetadata("format").find("application/pdf") != std::string::npos)
res = PDF;
if (headers.count("Content-Type") &&
headers["Content-Type"].find("application/pdf") != std::string::npos)
res = PDF;
if (res == EPUB)
{
void* handler = client->zipOpen(path);