hi all...
I was playing around with custom response and noticed that you couldn't
reset the default Apache response after setting a custom response:
# where "old" describes a lack of any ErrorDocument configs
my $old = $r->custom_response(SERVER_ERROR, "/error.html");
# blammo - no data
my $new = $r->custom_response(SERVER_ERROR, $old);
# or just plain undef to get core Apache back
$r->custom_response(SERVER_ERROR, undef());
this seems to work while still returning the current ErrorDocument...
--Geoff
Index: Apache.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.121
diff -u -r1.121 Apache.xs
--- Apache.xs 2001/05/01 17:28:37 1.121
+++ Apache.xs 2001/06/01 15:32:20
@@ -254,10 +254,15 @@
idx = index_of_response(status);
retval = conf->response_code_strings[idx];
- if (string) {
+ if (*string) {
+ /* they passed in a response string */
conf->response_code_strings[idx] =
((is_url(string) || (*string == '/')) && (*string != '"')) ?
pstrdup(r->pool, string) : pstrcat(r->pool, "\"", string,
NULL);
+ }
+ else {
+ /* they tried to undef the custom response */
+ conf->response_code_strings[idx] = NULL;
}
return retval;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]