Commit dc0ee0fe authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1725149, r1726233, r1729374, r1729374 from trunk:

allow expressions to be used in SetHandler. Opt-in with expr= prefix.



from feedback, assume all parameters to SetHandler are expressions.

I couldnt come up with a plausible handler name that was an 
invalid expression.


1726233 temporarily broke UDS r->handler case sensitivity


1726233 temporarily broke UDS r->handler case sensitivity

Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1729876 13f79535-47bb-0310-9956-ffa450edef68
parent 4ff41a25
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-

Changes with Apache 2.4.19
  *) core: Add expression support to SetHandler.
     [Eric Covener]

  *) core: Prevent a server crash in case of an invalid CONNECT request with
     a custom error page for status code 400 that uses server side includes.
+0 −10
Original line number Diff line number Diff line
@@ -112,16 +112,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) core: Add expression support to SetHandler (someone wanted this in
     a well-articulated serverfault post).
     trunk patch:  http://svn.apache.org/r1725149
                   http://svn.apache.org/r1725151
                   http://svn.apache.org/r1726233
                   http://svn.apache.org/r1729374
     2.4.x patch: MMN/changes only: http://people.apache.org/~covener/patches/2.4.x-sethandler-expr-2.diff
                                    + http://svn.apache.org/r1729374 
     +1: covener, jim, ylavic

  *) core: introducing new hook "pre_close_connection" to give protocols other
     than http/1.1 a chance to send one last frame before close.
     Requires MMN bump
+11 −1
Original line number Diff line number Diff line
@@ -4173,11 +4173,12 @@ header</description>
<name>SetHandler</name>
<description>Forces all matching files to be processed by a
handler</description>
<syntax>SetHandler <var>handler-name</var>|None</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>
<override>FileInfo</override>
<compatibility>2.4.19 and later</compatibility>

<usage>
    <p>When placed into an <code>.htaccess</code> file or a
@@ -4212,6 +4213,15 @@ handler</description>
&lt;/FilesMatch&gt;
    </highlight>

    <p>String-valued expressions can be used to reference per-request 
    variables, including backreferences to named regular expressions:</p>

    <highlight language="config">
&lt;LocationMatch ^/app/(?&lt;sub&gt;[^/]+)/&gt;
     SetHandler "proxy:unix:/var/run/app_%{env:MATCH_sub}.sock|fcgi://localhost:8080"
&lt;/FilesMatch&gt;
    </highlight>

    <p>You can override an earlier defined <directive>SetHandler</directive>
    directive by using the value <code>None</code>.</p>

+2 −1
Original line number Diff line number Diff line
@@ -457,6 +457,7 @@
 *                          ap_get_protocol(). Add HTTP_MISDIRECTED_REQUEST.
 *                          Added ap_parse_token_list_strict() to httpd.h
 * 20120211.52 (2.4.17-dev) Add master conn_rec* member in conn_rec.
 * 20120211.53 (2.4.17-dev) Add epxr_hander to core_dir_config.
 */

#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -464,7 +465,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20120211
#endif
#define MODULE_MAGIC_NUMBER_MINOR 52                   /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 53                   /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+2 −2
Original line number Diff line number Diff line
@@ -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 */
@@ -642,7 +642,7 @@ typedef struct {
     */
    unsigned int cgi_pass_auth : 2;
    unsigned int qualify_redirect_url :2;

    ap_expr_info_t  *expr_handler;         /* forced with SetHandler */
} core_dir_config;

/* macro to implement off by default behaviour */
Loading