浏览代码

[HttpFoundation] Always force the request method to full caps

Jordi Boggiano 14 年之前
父节点
当前提交
f6bc712028
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Symfony/Component/HttpFoundation/Request.php

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

@@ -129,7 +129,7 @@ class Request
      *
      * @return Request A Request instance
      */
-    static public function create($uri, $method = 'get', $parameters = array(), $cookies = array(), $files = array(), $server = array())
+    static public function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array())
     {
         $defaults = array(
             'SERVER_NAME'          => 'localhost',
@@ -591,7 +591,7 @@ class Request
 
     public function isMethodSafe()
     {
-        return in_array(strtolower($this->getMethod()), array('get', 'head'));
+        return in_array($this->getMethod(), array('GET', 'HEAD'));
     }
 
     public function getETags()