Skip to content
Permalink
Browse files

Added minor optimizations to request handler

  • Loading branch information...
lorenzo committed May 31, 2016
1 parent 445e0cc commit 709c1ef707a8acc41c97954944913dde08ca18ad
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/Controller/Component/RequestHandlerComponent.php
@@ -159,7 +159,7 @@ public function initialize(array $config)
protected function _setExtension($request, $response)
{
$accept = $request->parseAccept();
if (empty($accept)) {
if (empty($accept) || current($accept)[0] === 'text/html') {
return;
}
@@ -202,11 +202,16 @@ public function startup(Event $event)
if (empty($this->ext) || in_array($this->ext, ['html', 'htm'])) {
$this->_setExtension($request, $this->response);
}
if (empty($this->ext) && $request->is('ajax')) {
$request->params['isAjax'] = $request->is('ajax');
if (empty($this->ext) && $request->params['isAjax']) {
$this->ext = 'ajax';
}
$request->params['isAjax'] = $this->request->is('ajax');
if ($request->is(['get', 'head', 'options'])) {
return;
}
foreach ($this->config('inputTypeMap') as $type => $handler) {
if (!is_callable($handler[0])) {

0 comments on commit 709c1ef

Please sign in to comment.
You can’t perform that action at this time.