refactoring various pieces of the framework.

This commit is contained in:
Taylor Otwell
2011-10-18 20:19:36 -05:00
parent e985057b4c
commit 9fc9f88a41
18 changed files with 193 additions and 114 deletions

View File

@@ -160,14 +160,11 @@ class Request {
/**
* Get the HTTP protocol for the request.
*
* This method will return either "https" or "http", depending on whether HTTPS
* is being used for the current request.
*
* @return string
*/
public static function protocol()
{
return (isset($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) !== 'off') ? 'https' : 'http';
return Arr::get($_SERVER, 'SERVER_PROTOCOL', 'HTTP/1.1');
}
/**
@@ -177,7 +174,7 @@ class Request {
*/
public static function secure()
{
return static::protocol() == 'https';
return isset($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) !== 'off';
}
/**