Update Content-Type support for PDF (#361)
This commit is contained in:
parent
ee77800821
commit
eb316d8263
|
@ -89,6 +89,7 @@ enum ContentType
|
|||
CT_APPLICATION_FONT_WOFF,
|
||||
CT_APPLICATION_FONT_WOFF2,
|
||||
CT_APPLICATION_VND_MS_FONTOBJ,
|
||||
CT_APPLICATION_PDF,
|
||||
CT_IMAGE_SVG_XML,
|
||||
CT_IMAGE_PNG,
|
||||
CT_IMAGE_JPG,
|
||||
|
|
|
@ -106,6 +106,11 @@ const string_view &webContentTypeToString(ContentType contenttype)
|
|||
"Content-Type: application/vnd.ms-fontobject\r\n";
|
||||
return sv;
|
||||
}
|
||||
case CT_APPLICATION_PDF:
|
||||
{
|
||||
static string_view sv = "Content-Type: application/pdf\r\n";
|
||||
return sv;
|
||||
}
|
||||
case CT_IMAGE_PNG:
|
||||
{
|
||||
static string_view sv = "Content-Type: image/png\r\n";
|
||||
|
@ -443,6 +448,8 @@ ContentType getContentType(const std::string &fileName)
|
|||
case 'p':
|
||||
if (extName == "png")
|
||||
return CT_IMAGE_PNG;
|
||||
else if(extName == "pdf")
|
||||
return CT_APPLICATION_PDF;
|
||||
break;
|
||||
case 's':
|
||||
if (extName == "svg")
|
||||
|
|
Loading…
Reference in New Issue