From: Geoffrey Young Date: Mon, 12 Jul 2004 17:03:18 +0000 (+0000) Subject: Enable special ErrorDocument value 'default' which restores the X-Git-Tag: STRIKER_2_0_51_RC1^2~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91ff5e789a9bd777e4e29b626ef9770e1806f7cd;p=thirdparty%2Fapache%2Fhttpd.git Enable special ErrorDocument value 'default' which restores the canned server response for the scope of the directive Reviewed by: nd, stas git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104252 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a63ab2e9367..e12381084f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.51 + *) Enable special ErrorDocument value 'default' which restores the + canned server response for the scope of the directive + [Geoffrey Young, Andre Malo] + *) work around MSIE Digest auth bug - if AuthDigestEnableQueryStringHack is set in r->subprocess_env allow mismatched query strings to pass. PR 27758. [Paul Querna, Geoffrey Young] diff --git a/server/core.c b/server/core.c index 817621d8b18..31354faad72 100644 --- a/server/core.c +++ b/server/core.c @@ -87,6 +87,9 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle; +/* magic pointer for ErrorDocument xxx "default" */ +static char errordocument_default; + static void *create_core_dir_config(apr_pool_t *a, char *dir) { core_dir_config *conf; @@ -701,6 +704,10 @@ char *ap_response_code_string(request_rec *r, int error_index) return NULL; } + if (dirconf->response_code_strings[error_index] == &errordocument_default) { + return NULL; + } + return dirconf->response_code_strings[error_index]; } @@ -1186,13 +1193,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] = &errordocument_default; + } + 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;