barries wrote:
> 
> On Thu, Jul 05, 2001 at 04:03:00PM +0100, Paul Sharpe wrote:
> > barries wrote:
> > >
> > > On Thu, Jul 05, 2001 at 03:21:12PM +0100, Paul Sharpe wrote:
> > > > Here's my handler...
> > > >
> > > > package Foo::Test;
> > > > use strict;
> > > > use warnings;
> > > > use Apache::Constants qw(:common HTTP_OK);
> > > >
> > > > sub handler {
> > > >   my $r = shift;
> > > >   my $uri = 'foo.html';
> > > >   $r->content_type('text/plain');
> > > >   $r->send_http_header;
> > > >   $r->lookup_uri($uri);
> > >
> > > Try: my $s = $r->lookup_uri($uri);
> > >
> > > >   $r->print("lookup_uri($uri) status = ",$r->status,"\n");
> > >
> > > Try: $s->status
> > >
> > > > }
> > > >
> > > > 1;
> >
> > Still returns
> >
> >   lookup_uri(foo.html) status = 200
> 
> The lookup succeeds whether or not the file exists (though it will fail
> if the httpd.conf forbids access).  This about the case of an
> all-virtual set of URIs where your mod_perl handler is simulating
> documents that don't exist.  Results other than HTTP_OK will only occur
> if the URI->filename translation fails for some reason.
> 
> In your case, I think you'd need to add
> 
>    my $c = $s->status ;
>    $c = HTTP_NOT_FOUND if $c eq HTTP_OK && ! -e $s->filename ;
> 
> and report the value of $c (also need to import HTTP_NOT_FOUND).
> 
> HTH,
> 
> Barrie

What would happen if the URI translated to something other than a file
e.g. CGI?

paul

--
Paul Sharpe                   Tel: +44 (20) 7407 5557
Miraclefish Ltd.              Fax: +44 (20) 7378 8711
Studio 12                     mailto:[EMAIL PROTECTED]
37 Tanner Street              http://www.miraclefish.com/
London SE1 3LF
UNITED KINGDOM

Reply via email to