]> granicus.if.org Git - apache-authnz-external/commitdiff
Pass REQUEST_METHOD to the external program as the METHOD environment variable (fix...
authorMicah Andersen <micah@bimi.org>
Mon, 22 Jul 2019 22:49:05 +0000 (18:49 -0400)
committerMicah Andersen <micah@bimi.org>
Mon, 22 Jul 2019 22:49:05 +0000 (18:49 -0400)
mod_authnz_external/mod_authnz_external.c

index a602d7a12372f77f567b4ff9619f01f09925f880..3f7603ed98bfd5cbbfdcca9a034065c6d9ca5f2d 100644 (file)
@@ -96,6 +96,7 @@
 #define ENV_HOST       "HOST"          /* Remote Host */
 #define ENV_HTTP_HOST  "HTTP_HOST"     /* Local Host */
 #define ENV_CONTEXT    "CONTEXT"       /* Arbitrary Data from Config */
+#define ENV_METHOD     "METHOD"        /* Request method (eg. GET, HEAD, POST, OPTIONS, etc.) */
 /* Undefine this if you do not want cookies passed to the script */
 #define ENV_COOKIE     "COOKIE"
 
@@ -460,6 +461,9 @@ static int exec_external(const char *extpath, const char *extmethod,
        if (r->uri)
            child_env[i++]= apr_pstrcat(p, ENV_URI"=", r->uri, NULL);
 
+       if (r->method)
+               child_env[i++] = apr_pstrcat(p, ENV_METHOD"=", r->method, NULL);
+
        if ((host= apr_table_get(r->headers_in, "Host")) != NULL)
            child_env[i++]= apr_pstrcat(p, ENV_HTTP_HOST"=", host, NULL);