]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Expose ap_method_register() to the admin with a new RegisterHttpMethod
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 3 Nov 2016 18:01:23 +0000 (18:01 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 3 Nov 2016 18:01:23 +0000 (18:01 +0000)
directive.
Backports: r1407599
Submitted by: sf

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-merge-http-strict@1767942 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/core.xml
server/core.c

diff --git a/CHANGES b/CHANGES
index dd23d8c48530ff93b92cd875805b4121a588e93d..5744a1a91c85bf219f33ca8a31554a3288bc1862 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.24
 
+  *) core: New directive RegisterHttpMethod for registering non-standard
+     HTTP methods. [Stefan Fritsch]
+
   *) core: New directive HttpProtocol which allows to disable HTTP/0.9
      support. [Stefan Fritsch]
 
index 72f4c777e668be29ec38f1ca0b780656094e9057..08c1b323b92bac0006a3841b826a78f00cf8553c 100644 (file)
@@ -4766,5 +4766,20 @@ as if 'QualifyRedirectURL ON' was configured.</compatibility>
 </directivesynopsis>
 
 
+<directivesynopsis>
+<name>RegisterHttpMethod</name>
+<description>Register non-standard HTTP methods</description>
+<syntax>RegisterHttpMethod <var>method</var> [<var>method</var> [...]]</syntax>
+<contextlist><context>server config</context></contextlist>
+
+<usage>
+<p>HTTP Methods that are not conforming to the relvant RFCs are normally
+rejected by request processing in Apache HTTPD. To avoid this, modules
+can register non-standard HTTP methods they support.
+The <directive>RegisterHttpMethod</directive> allows to register such
+methods manually. This can be useful for if such methods are forwared
+for external processing, e.g. to a CGI script.</p>
+</usage>
+</directivesynopsis>
 
 </modulesynopsis>
index 4cb03ff85466ce04faeeb1bb2682b4d29f177b5d..58b95ccf2bc918254fcf4493095a345aae77dce8 100644 (file)
@@ -3917,6 +3917,15 @@ static const char *set_http_protocol(cmd_parms *cmd, void *dummy,
     return "HttpProtocol must be min=0.9|1.0";
 }
 
+static const char *set_http_method(cmd_parms *cmd, void *conf, const char *arg)
+{
+    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+    if (err != NULL)
+        return err;
+    ap_method_register(cmd->pool, arg);
+    return NULL;
+}
+
 static apr_hash_t *errorlog_hash;
 
 static int log_constant_item(const ap_errorlog_info *info, const char *arg,
@@ -4443,6 +4452,8 @@ AP_INIT_TAKE1("ProtocolsHonorOrder", set_protocols_honor_order, NULL, RSRC_CONF,
               "by default the client specified order determines selection"),
 AP_INIT_TAKE1("HttpProtocol", set_http_protocol, NULL, RSRC_CONF,
               "'min=0.9' (default) or 'min=1.0' to allow/deny HTTP/0.9"),
+AP_INIT_ITERATE("RegisterHttpMethod", set_http_method, NULL, RSRC_CONF,
+                "Registers non-standard HTTP methods"),
 { NULL }
 };