From: Geoffrey Young Date: Fri, 9 Apr 2004 00:56:26 +0000 (+0000) Subject: Enable special ErrorDocument value 'default' which restores the X-Git-Tag: pre_ajp_proxy~399 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f8667a2c8dbfc59a7c48f7c1e296c76599f9144;p=apache Enable special ErrorDocument value 'default' which restores the canned server response for the scope of the directive. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103310 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8d239a457d..f536888251 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Enable special ErrorDocument value 'default' which restores the + canned server response for the scope of the directive. + [Geoffrey Young] + *) Allow Digest providers to return AUTH_DENIED to propagate a 401 status and terminate the provider chain prior to checking the password. [Geoffrey Young] diff --git a/server/core.c b/server/core.c index 1148a38899..302aa0798d 100644 --- a/server/core.c +++ b/server/core.c @@ -271,9 +271,7 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) sizeof(*conf->response_code_strings) * RESPONSE_CODES); for (i = 0; i < RESPONSE_CODES; ++i) { - if (new->response_code_strings[i] != NULL) { - conf->response_code_strings[i] = new->response_code_strings[i]; - } + conf->response_code_strings[i] = new->response_code_strings[i]; } } /* Otherwise we simply use the base->response_code_strings array @@ -1178,13 +1176,21 @@ static const char *set_error_document(cmd_parms *cmd, void *conf_, RESPONSE_CODES); } - /* hack. Prefix a " if it is a msg; as that is what - * http_protocol.c relies on to distinguish between - * a msg and a (local) path. - */ - conf->response_code_strings[index_number] = (what == MSG) ? - apr_pstrcat(cmd->pool, "\"",msg,NULL) : - apr_pstrdup(cmd->pool, msg); + if (strcmp(msg, "default") == 0) { + /* special case: ErrorDocument 404 default restores the + * canned server error response + */ + conf->response_code_strings[index_number] = NULL; + } + else { + /* hack. Prefix a " if it is a msg; as that is what + * http_protocol.c relies on to distinguish between + * a msg and a (local) path. + */ + conf->response_code_strings[index_number] = (what == MSG) ? + apr_pstrcat(cmd->pool, "\"",msg,NULL) : + apr_pstrdup(cmd->pool, msg); + } } return NULL;