From: André Malo Date: Fri, 14 Feb 2003 00:43:52 +0000 (+0000) Subject: Forward port of mod_actions' ability to handle arbitrary methods X-Git-Tag: pre_ajp_proxy~2150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c84887c3771696665d9ef60ac54462b80f8dc491;p=apache Forward port of mod_actions' ability to handle arbitrary methods with the Script directive. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98646 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f99aae4167..aa4e6c2af3 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Forward port of mod_actions' ability to handle arbitrary methods + with the Script directive. [André Malo] + *) mod_auth_digest no longer tries to guess AuthDigestDomain, if it's not specified. Now it assumes "/" as already documented. PR 16937. [André Malo] diff --git a/modules/mappers/mod_actions.c b/modules/mappers/mod_actions.c index 1f95fa68f0..578792b700 100644 --- a/modules/mappers/mod_actions.c +++ b/modules/mappers/mod_actions.c @@ -142,17 +142,23 @@ static const char *set_script(cmd_parms *cmd, void *m_v, const char *method, const char *script) { action_dir_config *m = (action_dir_config *)m_v; - int methnum; + + /* ap_method_register recognizes already registered methods, + * so don't bother to check its previous existence explicitely. + */ + int methnum = ap_method_register(cmd->pool, method); - methnum = ap_method_number_of(method); - if (methnum == M_TRACE) + if (methnum == M_TRACE) { return "TRACE not allowed for Script"; - else if (methnum == M_INVALID) - return "Unknown method type for Script"; - else - m->scripted[methnum] = script; + } + else if (methnum == M_INVALID) { + return apr_pstrcat(cmd->pool, "Could not register method '", method, + "' for Script", NULL); + } + m->scripted[methnum] = script; m->configured = 1; + return NULL; }