[Catalyst] Re: Problem using Static::Simple

Will Hawes wdhawes at gmail.com
Wed Sep 19 18:59:15 GMT 2007


On 19/09/2007, Will Hawes <wdhawes at gmail.com> wrote:
> Having upgraded all Catalyst modules to their latest versions today, I think I'm seeing strangeness with Static::Simple. I've boiled it down to the following:
>
> 1) $ catalyst.pl MyApp
>
> 2) Modify MyApp::Controller::Root::default() as follows:
>
> sub default {
>   my( $self, $c ) = @_;
>   $c->response->status(404);
>   $c->response->body( 'not found' );
> }
>
> 3) $ PATH_INFO=/static1 perl MyApp/script/myapp_cgi.pl
> Content-Length: 9
> Content-Type: text/html; charset=utf-8
> Status: 404
>
> not found
>
> When accessing the app through Apache using Firefox with the LiveHTTPHeaders extension, the response headers are reported as follows:
>
>  HTTP/1.x 404 OK
> Date: Wed, 19 Sep 2007 17:48:48 GMT
> Server: Apache/2.0.55 (Ubuntu) ...
> X-Catalyst: 5.7010
> Content-Length: 9
> Keep-Alive: timeout=15, max=99
> Connection: Keep-Alive
> Content-Type: text/html; charset=utf-8
>
> 4) Modify myapp.yml as follows (the intention being to serve static files from /var/www/static/*):
>
> static:
>   dirs: [ 'static' ]
>   include_path: [ '/var/www' ]
>
> 5) $ PATH_INFO=/static1 perl MyApp/script/myapp_cgi.pl
> Status: 404
>
> Note that the Catalyst-generated Content-Length and Content-Type response headers, as well as the response body, have disappeared. Accessing the script via Firefox with LiveHTTPHeaders now shows the following:
>
> HTTP/1.x 404 OK
> Date: Wed, 19 Sep 2007 17:48:17 GMT
> Server: Apache/2.0.55 (Ubuntu) ...
> X-Catalyst: 5.7010
> Keep-Alive: timeout=15, max=99
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/x-perl

Forgot to mention, these response headers cause Firefox to try to
download a PL file.

> I'd have thought a request for "/static1" should be ignored by Static::Simple using the above config and that only URLs like "/static/1" should be treated as pointing to static content.
>
> Have I misunderstood something?
>



More information about the Catalyst mailing list