fix handling of HEAD http requests.

This commit is contained in:
Taylor Otwell 2012-02-23 08:43:55 -06:00
parent e70261e962
commit f624a6849f
2 changed files with 12 additions and 1 deletions

View File

@ -33,6 +33,11 @@ public static function uri()
*/ */
public static function method() public static function method()
{ {
if ($_SERVER['REQUEST_METHOD'] == 'HEAD')
{
return 'GET';
}
return (static::spoofed()) ? $_POST[Request::spoofer] : $_SERVER['REQUEST_METHOD']; return (static::spoofed()) ? $_POST[Request::spoofer] : $_SERVER['REQUEST_METHOD'];
} }

View File

@ -26,7 +26,13 @@ class Router {
* *
* @var array * @var array
*/ */
public static $routes = array(); public static $routes = array(
'GET' => array(),
'POST' => array(),
'PUT' => array(),
'DELETE' => array(),
'HEAD' => array(),
);
/** /**
* All of the "fallback" routes that have been registered. * All of the "fallback" routes that have been registered.