[Catalyst] Problem using Static::Simple

Will Hawes wdhawes at gmail.com
Wed Sep 19 18:57:32 GMT 2007


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 ) =3D @_;
  $c->response->status(404);
  $c->response->body( 'not found' );
}

3) $ PATH_INFO=3D/static1 perl MyApp/script/myapp_cgi.pl
Content-Length: 9
Content-Type: text/html; charset=3Dutf-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=3D15, max=3D99
Connection: Keep-Alive
Content-Type: text/html; charset=3Dutf-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=3D/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=3D15, max=3D99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/x-perl

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070919/1cfcf=
e25/attachment-0001.htm


More information about the Catalyst mailing list