改进Request的type方法对image类型的判断 统一返回image

This commit is contained in:
thinkphp
2017-05-16 19:10:06 +08:00
parent 20216368c4
commit faffdee907

View File

@@ -88,20 +88,18 @@ class Request
* @var array 资源类型 * @var array 资源类型
*/ */
protected $mimeType = [ protected $mimeType = [
'xml' => 'application/xml,text/xml,application/x-xml', 'xml' => 'application/xml,text/xml,application/x-xml',
'json' => 'application/json,text/x-json,application/jsonrequest,text/json', 'json' => 'application/json,text/x-json,application/jsonrequest,text/json',
'js' => 'text/javascript,application/javascript,application/x-javascript', 'js' => 'text/javascript,application/javascript,application/x-javascript',
'css' => 'text/css', 'css' => 'text/css',
'rss' => 'application/rss+xml', 'rss' => 'application/rss+xml',
'yaml' => 'application/x-yaml,text/yaml', 'yaml' => 'application/x-yaml,text/yaml',
'atom' => 'application/atom+xml', 'atom' => 'application/atom+xml',
'pdf' => 'application/pdf', 'pdf' => 'application/pdf',
'text' => 'text/plain', 'text' => 'text/plain',
'png' => 'image/png', 'image' => 'image/png,image/jpg,image/jpeg,image/pjpeg,image/gif,image/webp,image/*',
'jpg' => 'image/jpg,image/jpeg,image/pjpeg', 'csv' => 'text/csv',
'gif' => 'image/gif', 'html' => 'text/html,application/xhtml+xml,*/*',
'csv' => 'text/csv',
'html' => 'text/html,application/xhtml+xml,*/*',
]; ];
protected $content; protected $content;