X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FFastCGI.pm;h=397bdc061c2f48390fe5c0a2acb6257d698a8ac7;hp=1ac5a3540ff01df47594e2cab7f2f9cdbcd3468c;hb=6f1f968a6bc42bf4a4b50a1ee22d3aaecd801876;hpb=85d9fce671016c9040775c8b4458cf9c72ec2208 diff --git a/lib/Catalyst/Engine/FastCGI.pm b/lib/Catalyst/Engine/FastCGI.pm index 1ac5a35..397bdc0 100644 --- a/lib/Catalyst/Engine/FastCGI.pm +++ b/lib/Catalyst/Engine/FastCGI.pm @@ -1,7 +1,11 @@ package Catalyst::Engine::FastCGI; -use strict; -use base 'Catalyst::Engine::CGI'; +use MRO::Compat; +use mro 'c3'; +use Moose; +extends 'Catalyst::Engine::CGI'; + +# eval { Class::MOP::load_class("FCGI") }; eval "use FCGI"; die "Unable to load the FCGI module, you may need to install it:\n$@\n" if $@; @@ -159,6 +163,15 @@ sub write { $self->prepare_write($c); $self->{_prepared_write} = 1; } + + # XXX: We can't use Engine's write() method because syswrite + # appears to return bogus values instead of the number of bytes + # written: http://www.fastcgi.com/om_archive/mail-archive/0128.html + + # Prepend the headers if they have not yet been sent + if ( my $headers = delete $self->{_header_buf} ) { + $buffer = $headers . $buffer; + } # FastCGI does not stream data properly if using 'print $handle', # but a syswrite appears to work properly. @@ -315,6 +328,16 @@ application. For more information on using FastCGI under Apache, visit L +=head3 Authorization header with mod_fastcgi or mod_cgi + +By default, mod_fastcgi/mod_cgi do not pass along the Authorization header, +so modules like C will +not work. To enable pass-through of this header, add the following +mod_rewrite directives: + + RewriteCond %{HTTP:Authorization} ^(.+) + RewriteRule ^(.*)$ $1 [E=HTTP_AUTHORIZATION:%1,PT] + =head2 Lighttpd These configurations were tested with Lighttpd 1.4.7.