<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>
<highlight language="config">
<LocationMatch ^/app/(?<sub>[^/]+)/>
- 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"
</FilesMatch>
</highlight>
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 */
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 */
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;
}
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")) {