Permalink
Browse files

support using frontend proxy ??

  • Loading branch information...
1 parent b99905f commit 6b81f5ac93289baa2590732debb47cb108037cc4 @yusukebe committed Sep 23, 2009
Showing with 7 additions and 4 deletions.
  1. +1 −1 Makefile.PL
  2. +5 −2 lib/Noe.pm
  3. +1 −1 lib/Noe/Context.pm
View
@@ -5,7 +5,7 @@ all_from 'lib/Noe.pm';
# requires '';
tests 't/*.t';
-author_tests 'xt';
+#author_tests 'xt';
build_requires 'Test::More';
use_test_base;
View
@@ -32,8 +32,11 @@ sub BUILDARGS {
sub psgi_handler {
my $self = shift;
return sub {
- my $req = Plack::Request->new(shift);
- my $base = $req->base;
+ my $env = shift;
+ if( defined $env->{HTTP_X_FORWARDED_HOST} ){
+ $env->{SERVER_PORT} = $env->{HTTP_X_FORWARDED_PORT} || 80;
+ }
+ my $req = Plack::Request->new($env);
my $context = Noe::Context->new(
request => $req,
View
@@ -30,7 +30,7 @@ sub render {
my $template = Template->new($config);
my $out;
$args->{req} = $self->req;
- $args->{base} = $self->req->base; #xxx
+ $args->{base} = $self->req->base; #xxx
$template->process( $tmpl, $args, \$out )
|| die $template->error(), "\n";
$out = encode( 'utf8', $out );

0 comments on commit 6b81f5a

Please sign in to comment.