diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 3a5e1eb5a..4ea520280 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -393,19 +393,19 @@ class CakeRequest implements ArrayAccess { } } } - + /** * Get the content type used in this request. * * @return string */ - public function contentType() { - $type = env('CONTENT_TYPE'); - if ($type) { - return $type; - } - return env('HTTP_CONTENT_TYPE'); - } + public function contentType() { + $type = env('CONTENT_TYPE'); + if ($type) { + return $type; + } + return env('HTTP_CONTENT_TYPE'); + } /** * Get the IP the client is using, or says they are using. diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 307245d21..e1c1d3598 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -145,21 +145,21 @@ class CakeRequestTest extends CakeTestCase { $request = new CakeRequest(null, false); $this->assertFalse(isset($request->query['one'])); } - + /** * Test the content type method. * * @return void */ - public function testContentType() { - $_SERVER['HTTP_CONTENT_TYPE'] = 'application/json'; - $request = new CakeRequest('/', false); - $this->assertEquals('application/json', $request->contentType()); + public function testContentType() { + $_SERVER['HTTP_CONTENT_TYPE'] = 'application/json'; + $request = new CakeRequest('/', false); + $this->assertEquals('application/json', $request->contentType()); - $_SERVER['CONTENT_TYPE'] = 'application/xml'; - $request = new CakeRequest('/', false); - $this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.'); - } + $_SERVER['CONTENT_TYPE'] = 'application/xml'; + $request = new CakeRequest('/', false); + $this->assertEquals('application/xml', $request->contentType(), 'prefer non http header.'); + } /** * Test construction