Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

return Content-Length

  • Loading branch information...
commit 7ee8edb7e8dd68f37df23adb3857993f78a728fd 1 parent 46f1b53
@yusukebe authored
Showing with 4 additions and 4 deletions.
  1. +1 −0  eg/MyApp/myapp.psgi
  2. +2 −3 lib/Noe.pm
  3. +1 −1  lib/Noe/Context.pm
View
1  eg/MyApp/myapp.psgi
@@ -1,3 +1,4 @@
+use lib qw( ../../lib ./lib );
use MyApp;
use Plack::Builder;
View
5 lib/Noe.pm
@@ -51,10 +51,9 @@ sub psgi_handler {
my $dispatcher = "${app}::Dispatcher";
$dispatcher->require or die "can't find dispatcher : $@";
my $rule = $dispatcher->match($req);
- no warnings;
my $controller = "${app}::Controller::$rule->{controller}";
- use warnings;
- $controller->use or return $self->handle_404;
+ eval { $controller->use };
+ if ($@) { return $self->handle_404 }
my $method = $rule->{action} or return $self->handle_404;
my $code;
eval { $code = $controller->$method($context, $rule->{args}) };
View
2  lib/Noe/Context.pm
@@ -36,7 +36,7 @@ sub render {
$template->process( $tmpl, $args, \$out )
|| die $template->error(), "\n";
$out = encode( 'utf8', $out );
- return [ 200, [ 'Content-Type' => 'text/html' ], [$out] ];
+ return [ 200, [ 'Content-Type' => 'text/html', 'Content-Length' => length $out ], [$out] ];
}
sub redirect {
Please sign in to comment.
Something went wrong with that request. Please try again.