Skip to content

Commit

Permalink
Build a full URL for the redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
rayners committed May 26, 2010
1 parent f53d48f commit 1947122
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Smolder/Redirect.pm
Expand Up @@ -3,6 +3,8 @@ use strict;
use warnings;
use base 'CGI::Application';

use Smolder::Conf qw( HostName Port );

sub setup {
my $self = shift;
$self->run_modes( ['redirect'] );
Expand All @@ -12,7 +14,10 @@ sub setup {
sub redirect {
my $self = shift;
$self->header_type('redirect');
$self->header_add( -uri => '/app' );
$self->header_add( -uri => 'http://'
. HostName
. ( Port == 80 ? '' : ':' . Port )
. '/app' );
return "Redirecting...\n";
}

Expand Down

0 comments on commit 1947122

Please sign in to comment.