X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=55845cd2bd9206d9f29f58d63cbf4f625e86f893;hb=no_path_dispatch;hp=b959d7ccdaee03edd8d51309b74ca2e110bdaefb;hpb=0df490ef10f0a2deaa3b7950e721fa44659de860;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b959d7c..55845cd 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -23,6 +23,7 @@ use Path::Class::File (); use URI (); use URI::http; use URI::https; +use HTML::Entities; use Tree::Simple qw/use_weak_refs/; use Tree::Simple::Visitor::FindByUID; use Class::C3::Adopt::NEXT; @@ -52,11 +53,11 @@ has request => ( is => 'rw', default => sub { my $self = shift; - $self->request_class->new($self->_build_request_class_construction_parameters); + $self->request_class->new($self->_build_request_constructor_args); }, lazy => 1, ); -sub _build_request_class_construction_parameters { +sub _build_request_constructor_args { my $self = shift; my %p = ( _log => $self->log ); $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; @@ -67,11 +68,11 @@ has response => ( is => 'rw', default => sub { my $self = shift; - $self->response_class->new($self->_build_response_class_construction_parameters); + $self->response_class->new($self->_build_response_constructor_args); }, lazy => 1, ); -sub _build_response_class_construction_parameters { +sub _build_response_constructor_args { my $self = shift; { _log => $self->log }; } @@ -112,7 +113,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90016'; +our $VERSION = '5.90030'; sub import { my ( $class, @arguments ) = @_; @@ -266,9 +267,9 @@ MYAPP_WEB_HOME. If both variables are set, the MYAPP_HOME one will be used. If none of these are set, Catalyst will attempt to automatically detect the home directory. If you are working in a development environment, Catalyst -will try and find the directory containing either Makefile.PL, Build.PL or -dist.ini. If the application has been installed into the system (i.e. -you have done C), then Catalyst will use the path to your +will try and find the directory containing either Makefile.PL, Build.PL, +dist.ini, or cpanfile. If the application has been installed into the system +(i.e. you have done C), then Catalyst will use the path to your application module, without the .pm extension (e.g., /foo/MyApp if your application was installed at /foo/MyApp.pm) @@ -1341,9 +1342,13 @@ sub uri_for { my $args = join('/', grep { defined($_) } @args); $args =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE $args =~ s!^/+!!; - my $base = $c->req->base; - my $class = ref($base); - $base =~ s{(?req->base; + $class = ref($base); + $base =~ s{(?log->error($error); } + # Support skipping finalize for psgix.io style 'jailbreak'. Used to support + # stuff like cometd and websockets + + if($c->request->has_io_fh) { + $c->log_response; + return; + } + # Allow engine to handle finalize flow (for POE) my $engine = $c->engine; if ( my $code = $engine->can('finalize') ) { @@ -1869,6 +1882,7 @@ sub finalize_headers { if ( !$response->has_body ) { # Add a default body if none is already present + my $encoded_location = encode_entities($location); $response->body(<<"EOF"); @@ -1876,7 +1890,7 @@ sub finalize_headers { Moved -

This item has moved here.

+

This item has moved here.

EOF @@ -3387,6 +3401,8 @@ marcus: Marcus Ramberg miyagawa: Tatsuhiko Miyagawa +mgrimes: Mark Grimes + mst: Matt S. Trout mugwump: Sam Vilain