Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of http://github.com/rayners/smolder

  • Loading branch information...
commit 9b6e6f6245e7b47b2bc9c04a62c568f1cd524a77 2 parents 089d553 + 99c4e4e
@mpeters authored
Showing with 10 additions and 5 deletions.
  1. +3 −3 lib/Smolder/Control.pm
  2. +7 −2 lib/Smolder/Redirect.pm
View
6 lib/Smolder/Control.pm
@@ -13,7 +13,7 @@ use CGI::Cookie;
# BEGIN { $ENV{CGI_APP_DEBUG} = 1 ; } use CGI::Application::Plugin::DebugScreen;
use Smolder;
use Smolder::Util;
-use Smolder::Conf qw(ErrorsToScreen HostName LogFile LogLevel TemplateDir);
+use Smolder::Conf qw(ErrorsToScreen HostName Port LogFile LogLevel TemplateDir);
use Smolder::DB::Developer;
use Smolder::DB::Project;
use File::Spec::Functions qw(catdir catfile tmpdir);
@@ -292,10 +292,10 @@ sub static_url {
my ($self, $url) = @_;
# TODO - fix this after the switch to CGI::Application::Server
- return $url;
+ #return $url;
$url =~ s/^\///;
- return catfile('', $Smolder::VERSION, $url);
+ return $url;
}
=head2 add_message
View
9 lib/Smolder/Redirect.pm
@@ -3,16 +3,21 @@ use strict;
use warnings;
use base 'CGI::Application';
+use Smolder::Conf qw( HostName Port );
+
sub setup {
my $self = shift;
- $self->run_modes(['redirect']);
+ $self->run_modes( ['redirect'] );
$self->start_mode('redirect');
}
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";
}
Please sign in to comment.
Something went wrong with that request. Please try again.