in reply to mod_perl, getting filename or mime type

I think the reasonable approach is to look at just the uri:

sub handler { my $r = shift; my $log = $r->log; # The real content type is not available # until the ContentHandler my ($content_type) = $r->uri() =~ /\.(\w+)$/; my %ignore = map {$_ => 1} qw(gif jpg jpeg png css); if ($ignore{lc($content_type)}) { $log->debug( "Allowing access to ($content_type)." ); return DECLINED; } ...

-derby

Replies are listed 'Best First'.
Re^2: mod_perl, getting filename or mime type
by pingo (Hermit) on Nov 15, 2006 at 14:17 UTC
    Thanks. I think I'll go for a combined derby/Joost approach (use a different vhost for the content that I have control over myself, look at uri's for the content I don't have control over).