Skip to content
Permalink
Browse files

Moving features from RequestHandler into CakeRequest.

  • Loading branch information...
markstory committed May 8, 2010
1 parent df91002 commit 78bd7300a2c50e92af52c9a2da2221499909ed92
Showing with 9 additions and 0 deletions.
  1. +5 −0 cake/libs/cake_request.php
  2. +4 −0 cake/tests/cases/libs/cake_request.test.php
@@ -380,6 +380,11 @@ public function clientIp($safe = true) {
*/
public function referer($local = false) {
$ref = env('HTTP_REFERER');
$forwarded = env('HTTP_X_FORWARDED_HOST');
if ($forwarded) {
$ref = $forwarded;
}
$base = '';
if (defined('FULL_BASE_URL')) {
$base = FULL_BASE_URL;
@@ -466,6 +466,10 @@ function testReferer() {
$_SERVER['HTTP_REFERER'] = FULL_BASE_URL . 'recipes/add';
$result = $request->referer(true);
$this->assertIdentical($result, '/recipes/add');
$_SERVER['HTTP_X_FORWARDED_HOST'] = 'cakephp.org';
$result = $request->referer();
$this->assertIdentical($result, 'cakephp.org');
}
/**

0 comments on commit 78bd730

Please sign in to comment.
You can’t perform that action at this time.