]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Enable special ErrorDocument value 'default' which restores the
authorGeoffrey Young <geoff@apache.org>
Mon, 12 Jul 2004 17:03:18 +0000 (17:03 +0000)
committerGeoffrey Young <geoff@apache.org>
Mon, 12 Jul 2004 17:03:18 +0000 (17:03 +0000)
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

CHANGES
server/core.c

diff --git a/CHANGES b/CHANGES
index a63ab2e9367064a92bee465f71f15c187e734398..e12381084f1908bd0608ccf95b03a640d4e06334 100644 (file)
--- 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]
index 817621d8b18d229afaff2763dd33d6068102c558..31354faad721c26c9cf97581e49292fe294f29a8 100644 (file)
@@ -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;