浏览代码

Removed ability to override method from GET request

Miha Vrhovnik 14 年之前
父节点
当前提交
2e286073a4

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

@@ -603,8 +603,6 @@ class Request
             $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));
             if ('POST' === $this->method) {
                 $this->method = strtoupper($this->server->get('X-HTTP-METHOD-OVERRIDE', $this->request->get('_method', 'POST')));
-            } else if ('GET' === $this->method) {
-                $this->method = strtoupper($this->query->get('_method', 'GET'));
             }
         }
 

+ 0 - 5
tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php

@@ -462,11 +462,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
         $request->setMethod('POST');
         $request->server->set('X-HTTP-METHOD-OVERRIDE', 'delete');
         $this->assertEquals('DELETE', $request->getMethod(), '->getMethod() returns the method from X-HTTP-Method-Override if defined and POST');
-
-        $request = new Request();
-        $request->setMethod('GET');
-        $request->query->set('_method', 'purge');
-        $this->assertEquals('PURGE', $request->getMethod(), '->getMethod() returns the method from _method if defined and GET');
     }
 
     /**