mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
Add CT_TEXT_JAVASCRIPT
(#1654)
This commit is contained in:
parent
61073b4f74
commit
74bb47c690
@ -102,7 +102,8 @@ enum ContentType
|
||||
CT_TEXT_PLAIN,
|
||||
CT_TEXT_HTML,
|
||||
CT_APPLICATION_X_FORM,
|
||||
CT_APPLICATION_X_JAVASCRIPT,
|
||||
CT_APPLICATION_X_JAVASCRIPT [[deprecated("use CT_TEXT_JAVASCRIPT")]],
|
||||
CT_TEXT_JAVASCRIPT,
|
||||
CT_TEXT_CSS,
|
||||
CT_TEXT_XML,
|
||||
CT_APPLICATION_XML,
|
||||
|
@ -393,7 +393,7 @@ ContentType getContentType(const std::string &fileName)
|
||||
case 2:
|
||||
{
|
||||
if (extName == "js")
|
||||
return CT_APPLICATION_X_JAVASCRIPT;
|
||||
return CT_TEXT_JAVASCRIPT;
|
||||
return CT_APPLICATION_OCTET_STREAM;
|
||||
}
|
||||
case 3:
|
||||
@ -569,6 +569,11 @@ const string_view &contentTypeToMime(ContentType contenttype)
|
||||
static string_view sv = "application/x-javascript; charset=utf-8";
|
||||
return sv;
|
||||
}
|
||||
case CT_TEXT_JAVASCRIPT:
|
||||
{
|
||||
static string_view sv = "text/javascript; charset=utf-8";
|
||||
return sv;
|
||||
}
|
||||
case CT_TEXT_CSS:
|
||||
{
|
||||
static string_view sv = "text/css; charset=utf-8";
|
||||
|
Loading…
Reference in New Issue
Block a user