Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Optimize the content type search.

Move most commonly used types to the top
of the list.  This reduces the time spent
iterating content types.
  • Loading branch information...
commit 2c1b5d978dc7a5b4442e22977191ad8af2688751 1 parent 37d235f
@markstory markstory authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Cake/Network/CakeResponse.php
View
8 lib/Cake/Network/CakeResponse.php
@@ -80,6 +80,10 @@ class CakeResponse {
* @var array
*/
protected $_mimeTypes = array(
+ 'html' => array('text/html', '*/*'),
+ 'json' => 'application/json',
+ 'xml' => array('application/xml', 'text/xml'),
+ 'rss' => 'application/rss+xml',
'ai' => 'application/postscript',
'bcpio' => 'application/x-bcpio',
'bin' => 'application/octet-stream',
@@ -206,7 +210,6 @@ class CakeResponse {
'f90' => 'text/plain',
'h' => 'text/plain',
'hh' => 'text/plain',
- 'html' => array('text/html', '*/*'),
'htm' => array('text/html', '*/*'),
'ics' => 'text/calendar',
'm' => 'text/plain',
@@ -218,7 +221,6 @@ class CakeResponse {
'tpl' => 'text/template',
'txt' => 'text/plain',
'text' => 'text/plain',
- 'xml' => array('application/xml', 'text/xml'),
'avi' => 'video/x-msvideo',
'fli' => 'video/x-fli',
'mov' => 'video/quicktime',
@@ -261,12 +263,10 @@ class CakeResponse {
'pdb' => 'chemical/x-pdb',
'xyz' => 'chemical/x-pdb',
'javascript' => 'text/javascript',
- 'json' => 'application/json',
'form' => 'application/x-www-form-urlencoded',
'file' => 'multipart/form-data',
'xhtml' => array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
'xhtml-mobile' => 'application/vnd.wap.xhtml+xml',
- 'rss' => 'application/rss+xml',
'atom' => 'application/atom+xml',
'amf' => 'application/x-amf',
'wap' => array('text/vnd.wap.wml', 'text/vnd.wap.wmlscript', 'image/vnd.wap.wbmp'),
Please sign in to comment.
Something went wrong with that request. Please try again.