소스 검색

added text/html to default format mapping

Lukas Kahwe Smith 14 년 전
부모
커밋
c2ac8304b0
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      src/Symfony/Component/HttpFoundation/Request.php
  2. 1 1
      tests/Symfony/Tests/Component/HttpKernel/ResponseListenerTest.php

+ 1 - 0
src/Symfony/Component/HttpFoundation/Request.php

@@ -974,6 +974,7 @@ class Request
     static protected function initializeFormats()
     {
         static::$formats = array(
+            'html' => array('text/html', 'application/xhtml+xml'),
             'txt'  => array('text/plain'),
             'js'   => array('application/javascript', 'application/x-javascript', 'text/javascript'),
             'css'  => array('text/css'),

+ 1 - 1
tests/Symfony/Tests/Component/HttpKernel/ResponseListenerTest.php

@@ -62,7 +62,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->kernel, Request::create('/'), HttpKernelInterface::MASTER_REQUEST, $response);
         $this->dispatcher->dispatch(Events::onCoreResponse, $event);
 
-        $this->assertEquals('', $event->getResponse()->headers->get('content-type'));
+        $this->assertEquals('text/html', $event->getResponse()->headers->get('content-type'));
     }
 
     public function testFilterSetContentType()