]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
from feedback, assume all parameters to SetHandler are expressions.
authorEric Covener <covener@apache.org>
Fri, 22 Jan 2016 15:30:19 +0000 (15:30 +0000)
committerEric Covener <covener@apache.org>
Fri, 22 Jan 2016 15:30:19 +0000 (15:30 +0000)
I couldnt come up with a plausible handler name that was an
invalid expression.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726233 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/core.xml
include/http_core.h
server/core.c

index 1035178ce218269ba5423ea8a227b25a198c23e1..f768594f028e45ea1b832b0b80aec4e95b142032 100644 (file)
@@ -4318,7 +4318,7 @@ header</description>
 <name>SetHandler</name>
 <description>Forces all matching files to be processed by a
 handler</description>
-<syntax>SetHandler <var>handler-name</var>|None|expr=<var>expression</var></syntax>
+<syntax>SetHandler <var>handler-name</var>|none|<var>expression</var></syntax>
 <contextlist><context>server config</context><context>virtual host</context>
 <context>directory</context><context>.htaccess</context>
 </contextlist>
@@ -4365,7 +4365,7 @@ SetHandler imap-file
 
     <highlight language="config">
 &lt;LocationMatch ^/app/(?&lt;sub&gt;[^/]+)/&gt;
-     SetHandler "expr=proxy:unix:/var/run/app_%{env:MATCH_sub}.sock|fcgi://localhost:8080"
+     SetHandler "proxy:unix:/var/run/app_%{env:MATCH_sub}.sock|fcgi://localhost:8080"
 &lt;/FilesMatch&gt;
     </highlight>
 
index eaff248575c54e5a0c69da13c0c5a733d40b523a..684fba49cfc71da3719ce1182330b9c12c482704 100644 (file)
@@ -565,7 +565,7 @@ typedef struct {
     ap_regex_t *r;
 
     const char *mime_type;       /* forced with ForceType  */
-    const char *handler;         /* forced with SetHandler */
+    const char *handler;         /* forced by something other than SetHandler */
     const char *output_filters;  /* forced with SetOutputFilters */
     const char *input_filters;   /* forced with SetInputFilters */
     int accept_path_info;        /* forced with AcceptPathInfo */
@@ -646,7 +646,7 @@ typedef struct {
     apr_hash_t *response_code_exprs;
 
     unsigned int qualify_redirect_url :2;
-    ap_expr_info_t  *expr_handler;         /* forced with SetHandler expr= */
+    ap_expr_info_t  *expr_handler;         /* forced with SetHandler */
 } core_dir_config;
 
 /* macro to implement off by default behaviour */
index 5f276c4ca891083874d144a50f1969b2644e111d..3b6eaebe6bc9fc0e699716ac79dd16209ac623c4 100644 (file)
@@ -1969,27 +1969,14 @@ static const char *set_sethandler(cmd_parms *cmd,
                                      const char *arg_)
 {
     core_dir_config *dirconf = d_;
-
-    if (!strncmp(arg_, "expr=", 5)) {
-        const char *err;
-        dirconf->expr_handler = ap_expr_parse_cmd(cmd, arg_+5,
+    const char *err;
+    dirconf->expr_handler = ap_expr_parse_cmd(cmd, arg_,
                                           AP_EXPR_FLAG_STRING_RESULT,
                                           &err, NULL);
-        if (err) {
-            return apr_pstrcat(cmd->pool,
-                    "Can't parse expression : ", err, NULL);
-        }
-        return NULL;
-    }
-    else if (arg_ == ap_strstr_c(arg_, "proxy:unix")) { 
-        dirconf->handler = arg_;
-    }
-    else { 
-        char *arg = apr_pstrdup(cmd->pool,arg_);
-        ap_str_tolower(arg);
-        dirconf->handler = arg;
+    if (err) {
+        return apr_pstrcat(cmd->pool,
+                "Can't parse expression : ", err, NULL);
     }
-
     return NULL;
 }
 
@@ -4668,7 +4655,13 @@ static int core_override_type(request_rec *r)
             return HTTP_INTERNAL_SERVER_ERROR;
         }
         if (strcmp(val, "none")) { 
-            r->handler = apr_pstrdup(r->pool, val);
+            if (val != ap_strstr_c(val, "proxy:unix")) { 
+                /* Retained for compatibility --  but not for UDS */
+                char *tmp = apr_pstrdup(r->pool, val);
+                ap_str_tolower(tmp);
+                r->handler = tmp;
+            }
+            r->handler = val;
         }
     }
     else if (conf->handler && strcmp(conf->handler, "none")) {