]> granicus.if.org Git - apache/commitdiff
Enable special ErrorDocument value 'default' which restores the
authorGeoffrey Young <geoff@apache.org>
Fri, 9 Apr 2004 00:56:26 +0000 (00:56 +0000)
committerGeoffrey Young <geoff@apache.org>
Fri, 9 Apr 2004 00:56:26 +0000 (00:56 +0000)
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

CHANGES
server/core.c

diff --git a/CHANGES b/CHANGES
index 8d239a457d0767f4debd68b7daedbf6a6129aa08..f5368882510f821f7f6faf98e48833e94b2ed7c3 100644 (file)
--- 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]
index 1148a388998e567d16d840ab09504e37dfad5456..302aa0798db5467dbe438902738b10d0ca0d3571 100644 (file)
@@ -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;