Commit 6c3c38cd authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Handle cases, esp when using mod_proxy_fcgi, when we do not

want SCRIPT_FILENAME to include the query string.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1242351 13f79535-47bb-0310-9956-ffa450edef68
parent ee630a7a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -735,7 +735,7 @@ expressions</description>
<name>ProxyPass</name>
<description>Maps remote servers into the local server URL-space</description>
<syntax>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var>
  <var>[key=value</var> ...]] [nocanon] [interpolate]</syntax>
  <var>[key=value</var> ...]] [nocanon] [interpolate] [noquery]</syntax>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context>
</contextlist>
@@ -1152,6 +1152,11 @@ expressions</description>
    so you may still have to resort to <module>mod_rewrite</module>
    for complex rules.</p>

    <p>Normally, mod_proxy will include the query string when
    generating the <var>SCRIPT_FILENAME</var> environment variable.
    The optional <var>noquery</var> keyword (available in
    httpd 2.4.1 and later) prevents this.</p>

    <p>When used inside a <directive type="section" module="core"
    >Location</directive> section, the first argument is omitted and the local
    directory is obtained from the <directive type="section" module="core"
+6 −0
Original line number Diff line number Diff line
@@ -636,6 +636,9 @@ PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
            /* mod_proxy_http needs to be told.  Different module. */
            apr_table_setn(r->notes, "proxy-nocanon", "1");
        }
        if (ent->flags & PROXYPASS_NOQUERY) {
            apr_table_setn(r->notes, "proxy-noquery", "1");
        }
        return OK;
    }

@@ -1394,6 +1397,9 @@ static const char *
        else if (!strcasecmp(word,"interpolate")) {
            flags |= PROXYPASS_INTERPOLATE;
        }
        else if (!strcasecmp(word,"noquery")) {
            flags |= PROXYPASS_NOQUERY;
        }
        else {
            char *val = strchr(word, '=');
            if (!val) {
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ struct proxy_remote {

#define PROXYPASS_NOCANON 0x01
#define PROXYPASS_INTERPOLATE 0x02
#define PROXYPASS_NOQUERY 0x04
struct proxy_alias {
    const char  *real;
    const char  *fake;
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static apr_status_t send_data(proxy_conn_rec *conn,
    while (to_write) {
        apr_size_t n = 0;
        rv = apr_socket_sendv(s, vec + offset, nvec - offset, &n);
        if (rv != APR_SUCCESS) {
        if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
            break;
        }
        if (n > 0) {
+9 −1
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
    const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
    int i;
    apr_port_t rport;
    char *q;

    /* use a temporary apr_table_t which we'll overlap onto
     * r->subprocess_env later
@@ -241,7 +242,14 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
    apr_table_addn(e, "CONTEXT_PREFIX", ap_context_prefix(r));
    apr_table_addn(e, "CONTEXT_DOCUMENT_ROOT", ap_context_document_root(r));
    apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
    if (apr_table_get(r->notes, "proxy-noquery") && (q = ap_strchr(r->filename, '?'))) {
        *q = '\0';
        apr_table_addn(e, "SCRIPT_FILENAME", apr_pstrdup(r->pool, r->filename));
        *q = '?';
    }
    else {
        apr_table_addn(e, "SCRIPT_FILENAME", r->filename);  /* Apache */
    }

    rport = c->client_addr->port;
    apr_table_addn(e, "REMOTE_PORT", apr_itoa(r->pool, rport));