Commit 717c68db authored by Geoffrey Young's avatar Geoffrey Young
Browse files

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
parent 2626cf5b
Loading
Loading
Loading
Loading
+4 −0
Changes for CHANGES: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
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]
+15 −0
Changes for server/core.c: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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,6 +1193,13 @@ static const char *set_error_document(cmd_parms *cmd, void *conf_,
                            RESPONSE_CODES);
        }

        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.
@@ -1194,6 +1208,7 @@ static const char *set_error_document(cmd_parms *cmd, void *conf_,
                    apr_pstrcat(cmd->pool, "\"",msg,NULL) :
                    apr_pstrdup(cmd->pool, msg);
        }
    }

    return NULL;
}