Skip to content

Commit

Permalink
support for request->referer and request->remote_address
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Sukrieh committed Feb 8, 2010
1 parent 86630b7 commit 7aee100
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Dancer/Request.pm
Expand Up @@ -19,11 +19,15 @@ Dancer::Request->attributes(
'accept_language', 'accept_charset',
'accept_encoding', 'keep_alive',
'connection', 'accept',
'referer',
);

# aliases
sub agent { $_[0]->user_agent }
sub referer { $_[0]->env->{'X_FORWARDED_FOR'} || $_[0]->env->{'REMOTE_ADDR'} }
sub agent { $_[0]->user_agent }

sub remote_address {
$_[0]->env->{'X_FORWARDED_FOR'} || $_[0]->env->{'REMOTE_ADDR'};
}

sub new {
my ($class, $env) = @_;
Expand Down

0 comments on commit 7aee100

Please sign in to comment.