Skip to content

Commit

Permalink
even better request information example for tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 30, 2013
1 parent ca7359d commit f4c5648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -214,13 +214,13 @@ full access to all HTTP features and information.
use Mojolicious::Lite;
# Access response and request headers
# Access request and reponse information
get '/agent' => sub {
my $self = shift;
my $host = $self->req->url->to_abs->host;
my $ua = $self->req->headers->user_agent;
$self->res->headers->header('X-Bender' => 'Bite my shiny metal ass!');
$self->render(text => qq{Request by "$ua" reached $host.});
$self->render(text => "Request by $ua reached $host.");
};
app->start;
Expand Down

0 comments on commit f4c5648

Please sign in to comment.