From f624a6849f6d4b32ce6187bffaf6293cad5277c7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 23 Feb 2012 08:43:55 -0600 Subject: [PATCH] fix handling of HEAD http requests. --- laravel/request.php | 5 +++++ laravel/routing/router.php | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/laravel/request.php b/laravel/request.php index fc6b1b51..21ed5cd9 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -33,6 +33,11 @@ public static function uri() */ public static function method() { + if ($_SERVER['REQUEST_METHOD'] == 'HEAD') + { + return 'GET'; + } + return (static::spoofed()) ? $_POST[Request::spoofer] : $_SERVER['REQUEST_METHOD']; } diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 715e920d..a311923f 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -26,7 +26,13 @@ class Router { * * @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.