httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17148] New: - SCRIPT_URI is missing port number for implied files from DirectoryIndex
Date Tue, 18 Feb 2003 03:07:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17148>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17148

SCRIPT_URI is missing port number for implied files from DirectoryIndex

           Summary: SCRIPT_URI is missing port number for implied files from
                    DirectoryIndex
           Product: Apache httpd-2.0
           Version: 2.0.44
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_dir
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: mattb@columbia.edu


I'm only guessing this is in mod_dir...it could be in mod_rewrite or something
entirely different for all I know.

Here's how to reproduce:

1. run a webserver on port 8080:

    Listen 8080

2. create a cgi-directory with the following properties

    Options +ExecCGI
    AddHandler cgi-script .cgi
    DirectoryIndex index.html ... index.cgi

3. create a file called index.cgi in that directory:

- - - - - - - - %< CUT HERE >% - - - - - - - -
#!/bin/sh                                                                       
echo 'Content-type: text/html'
echo
echo '<pre>'
echo "\$SCRIPT_URI = $SCRIPT_URI"
echo '</pre>'

exit 0
- - - - - - - - %< CUT HERE >% - - - - - - - -

4. Navigate to that file on your server. For example:

    lynx -source http://somehost.somedomain:8080/cgi-bin/index.cgi

You should see the following output:

<pre>
$SCRIPT_URI = http://somehost.somedomain:8080/cgi-bin/index.cgi
</pre>

5. Now navigate to just the CGI directory and let DirectoryIndex resolve to
index.cgi for you. For example:

    lynx -source http://somehost.somedomain:8080/cgi-bin/

You should now see the following output:

<pre>
$SCRIPT_URI = http://somehost.somedomain/cgi-bin/
</pre>

6. Notice how the port is missing in the second output.

Another way to see this is when running PHP in Apache. The
$_SERVER['SCRIPT_URI'] entry will be missing the port number for any script
arrived at through DirectoryIndex resolution.

I have not tried experimenting with any of the Rewrite* directives. I have not
tried this in Apache 1.x.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message