Yeah I've tried this (and variations, with $optReturnError both ways
as well) but it doesn't seem to do the job - I just get a blank page,
and if an ErrorDocument is defined it doesn't get picked up. The
difference can be seen below, with the first being the embperl page
doing a [- $req_rec->status(404); exit; -], and the second a real
non-existent page:

        storm:~> telnet localhost 80
        Trying 127.0.0.1...
        Connected to localhost.localdomain.
        Escape character is '^]'.
        GET /fail.ehtml HTTP/1.0
         
        HTTP/1.1 404 Not Found
        Date: Fri, 15 Sep 2000 01:31:06 GMT
        Server: Apache/1.3.12 (Unix) mod_perl/1.24
        Content-Length: 2
        Connection: close
        Content-Type: text/html
         
        Connection closed by foreign host.

vs. 

        storm:~> telnet localhost 80
        Trying 127.0.0.1...
        Connected to localhost.localdomain.
        Escape character is '^]'.
        GET /foobar.html HTTP/1.0
         
        HTTP/1.1 404 Not Found
        Date: Fri, 15 Sep 2000 01:31:17 GMT
        Server: Apache/1.3.12 (Unix) mod_perl/1.24
        Connection: close
        Content-Type: text/html; charset=iso-8859-1
         
        <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
        <HTML><HEAD>
        <TITLE>404 Not Found</TITLE>
        </HEAD><BODY>
        <H1>Not Found</H1>
        The requested URL /foobar.ehtml was not found on this server.<P>
        <HR>
        <ADDRESS>Apache/1.3.12 Server at storm Port 80</ADDRESS>
        </BODY></HTML>
        Connection closed by foreign host.

I was guessing it might be because even though the status has been set
manually Embperl as the handler is returning an OK?

Any suggestions where to go from here?

Cheers,
Gavin

On Thu, Sep 14, 2000 at 03:07:07PM +0200, Gerald Richter wrote:
> There isn't a possibility to return DECLINED, but you can set arbitarry http
> status codes by using the Apache API:
> 
> [-
> $req_rec -> status (401) ;
> exit ;
> -]
> 
> See "perldoc Apache" for more details
> 
> Gerald
>
> > I've got an Embperl page where I'd like to have Embperl stop
> > processing and return an Apache FORBIDDEN or DECLINED or some other
> > arbitrary handler return code if particular conditions are true.
> > Apache::exit does the stop but not the return code. I can think of a
> > few kludges, but was wondering if there's a nice elegant mechanism to
> > do this that I'm missing?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to