"Custom failure responses" in documentation
Seairth Jacobs <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
I am using version 2.4.2 on a WinXP box. As a result, I am using a
static instance (TCP port instead of a named pipe).
FastCgiServer cgi-bin/rna_fcgi_handler.py -port 8081
RewriteEngine On
RewriteRule ^/rna$ /cgi-bin/rna_fcgi_handler.py [PT]
RewriteRule ^/rna/(.*) /cgi-bin/rna_fcgi_handler.py/$1 [PT]
<LocationMatch "^/cgi-bin/rna_fcgi_handler\.py/[^/]+/client">
AuthType Basic
AuthName RNA_Client
FastCgiAuthenticator cgi-bin/rna_fcgi_handler.py
Require valid-user
</LocationMatch>
The first bit effectively replaces "/rna" with
"/cgi-bin/rna_fcgi_handler.py", passing the remaining bits as
PATH_INFO. If path_info matches "/*/client", then the same script is
called first for the Authorizer phase. The script itself distinguishes
between Authorizer and Responder phases internally.
As you can see, I am attempting to use the FastCgiAuthenticator
directive. For the most part, it seems to work with one exception. If
I return a response that is not 200 or 403 (such as 404 or 500), the
response is ignored and I get the authentication prompt again.
According to the following documentation:
"All headers returned by a FastCGI authentication application in a
successful response (Status: 200) are passed to sub-processes
(CGI/FastCGI invocations) as environment variables. All headers returned
in an unsuccessful response are passed on to the client."
I would have expected the error response to be returned. But then there
is the following documentation just below the prior bit:
"Custom failure responses from FastCGI authorizer applications are not
(yet?) supported. See the ErrorDocument
<http://httpd.apache.org/docs/mod/core.html#errordocument> directive for
a workaround (a FastCGI application can serve the document)."
I originally took the second bit to mean that if you returned a non-200
response code that Apache would just serve up its default response for
that code, which I could optionally override by using ErrorDocument.
But now I am beginning to wonder if the use of ErrorDocument is the
*only* way to return an error response.
Could someone clarify this for me? And if non-200 responses are really
supposed be going back to the client (and therefore ending the request),
what could I be missing?
Thanks,
Seairth
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/