httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject [BUG] include virtual and SCRIPT_NAME w/path_info
Date Sun, 28 Sep 1997 18:38:38 GMT
If I do an include virtual of /cgi-bin/printenv/full/path in a document, I
get:

SCRIPT_NAME=/cgi-bin/printenv/full/path

That should be:

SCRIPT_NAME=/cgi-bin/printenv

It is not because util_script.c has: 

    /* Note that the code below special-cases scripts run from includes,
     * because it "knows" that the sub_request has been hacked to have the
     * args and path_info of the original request, and not any that may have
     * come with the script URI in the include command.  Ugh.
     */

    if (!strcmp (r->protocol, "INCLUDED")) {
        table_set (e, "SCRIPT_NAME", r->uri);
        if (r->path_info && *r->path_info)
            table_set (e, "PATH_INFO", r->path_info);
    } else if (!r->path_info || !*r->path_info) {
        table_set (e, "SCRIPT_NAME", r->uri);
    } else {
        int path_info_start = find_path_info (r->uri, r->path_info);

        table_set (e, "SCRIPT_NAME", pstrndup(r->pool, r->uri,
                                              path_info_start));

        table_set (e, "PATH_INFO", r->path_info);
    }

What is it talking about?  I can't see how the comment applies to include
virtual.  I can see mod_include setting that for include CGI, but I don't
fully understand why.  

Grr.  I see.  The reason is because the semantics of exec cgi are a broken
pile of crap.  So what we want is a way to do the above for exec cgi only
and not include virtual.  We could change r->protocol to be different for
the two cases, but that is bad.  Ideas? 



Mime
View raw message