You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2007/03/28 02:11:16 UTC

DO NOT REPLY [Bug 28931] - Directory Indexes cannot contain a Query String

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28931>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28931





------- Additional Comments From basant.kukreja@sun.com  2007-03-27 17:11 -------
I was not able to reproduce the issue for http 2.2.x.

For me, behavior is identical in 2.2.x and 1.3.x. Here are the details :

Here is apache 1.3.x configuration :

----------------------------------------------
NameVirtualHost *:4014
AddHandler htmlhandler .html
Action htmlhandler /cgi-bin/htmlhandler.pl

<VirtualHost *:4014>
  ServerName a.com
  DirectoryIndex index.html?host=a
</VirtualHost>

<VirtualHost *:4014>
  ServerName b.com
  DirectoryIndex index.html?host=b
</VirtualHost>
----------------------------------------------

Here is the htmlhandler.pl . It basically dumps the environment variable
( helpful to show the query string etc.)
#!/usr/bin/perl

print "Content-Type: text/html\r\n";
print "\r\n";

foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
}
----------------------------------------------

For a request /tmp/req1.txt
GET / HTTP/1.1
Host: a.com
Connection: close

Response :

Date: Tue, 27 Mar 2007 23:56:58 GMT
Server: Apache/1.3.38-dev (Unix)
Content-Location: index.html.en
TCN: choice
Vary: negotiate,accept-language,accept-charset
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

420
DOCUMENT_ROOT="/disk/apache/apache13/htdocs"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_CONNECTION="close"
HTTP_HOST="a.com"
PATH=...
PATH_INFO="/index.html"
PATH_TRANSLATED="/disk/apache/apache13/htdocs/index.html.en"
QUERY_STRING="host=a"
REDIRECT_QUERY_STRING="host=a"
REDIRECT_REDIRECT_STATUS="200"
REDIRECT_STATUS="200"
REDIRECT_URL="/index.html"
REMOTE_PORT="37073"
REQUEST_METHOD="GET"
REQUEST_URI="/"
SCRIPT_FILENAME="/disk/apache/apache13/cgi-bin/htmlhandler.pl"
SCRIPT_NAME="/cgi-bin/htmlhandler.pl"
SERVER_ADMIN="basantk@lbasantk3.mydomain"
SERVER_NAME="a.com"
SERVER_PORT="4014"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE="<ADDRESS>Apache/1.3.38-dev Server at a.com Port 4014</ADDRESS>\n"
SERVER_SOFTWARE="Apache/1.3.38-dev (Unix)"

0

----------------------------------------------

For a request /tmp/req2.txt
GET / HTTP/1.1
Host: b.com
Connection: close


Response :
Date: Tue, 27 Mar 2007 23:57:02 GMT
Server: Apache/1.3.38-dev (Unix)
Content-Location: index.html.en
TCN: choice
Vary: negotiate,accept-language,accept-charset
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

420
DOCUMENT_ROOT="/disk/apache/apache13/htdocs"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_CONNECTION="close"
HTTP_HOST="b.com"
PATH=...
PATH_INFO="/index.html"
PATH_TRANSLATED="/disk/apache/apache13/htdocs/index.html.en"
QUERY_STRING="host=b"
REDIRECT_QUERY_STRING="host=b"
REDIRECT_REDIRECT_STATUS="200"
REDIRECT_STATUS="200"
REDIRECT_URL="/index.html"
REMOTE_PORT="37074"
REQUEST_METHOD="GET"
REQUEST_URI="/"
SCRIPT_FILENAME="/disk/apache/apache13/cgi-bin/htmlhandler.pl"
SCRIPT_NAME="/cgi-bin/htmlhandler.pl"
SERVER_ADMIN="basantk@lbasantk3.mydomain"
SERVER_NAME="b.com"
SERVER_PORT="4014"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE="<ADDRESS>Apache/1.3.38-dev Server at b.com Port 4014</ADDRESS>\n"
SERVER_SOFTWARE="Apache/1.3.38-dev (Unix)"

0
----------------------------------------------

Not the query string is different for a.com and b.com
----------------------------------------------

Now the same thing for httpd 2.2.x

NameVirtualHost *:4004
AddHandler htmlhandler .html
Action htmlhandler /cgi-bin/htmlhandler.pl

<VirtualHost *:4004>
  ServerName a.com
  DirectoryIndex index.html?host=a
</VirtualHost>

<VirtualHost *:4004>
  ServerName b.com
  DirectoryIndex index.html?host=b
</VirtualHost>
----------------------------------------------

For req1.txt 

Date: Wed, 28 Mar 2007 00:01:20 GMT
Server: Apache/2.2.5-dev (Unix) mod_ssl/2.2.5-dev OpenSSL/0.9.8a DAV/2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

417
DOCUMENT_ROOT="/disk/apache/apache2/htdocs"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_CONNECTION="close"
HTTP_HOST="a.com"
LANG="en_US"
PATH=...
PATH_INFO="/index.html"
PATH_TRANSLATED="/disk/apache/apache2/htdocs/index.html"
QUERY_STRING="host=a"
REDIRECT_HANDLER="htmlhandler"
REDIRECT_QUERY_STRING="host=a"
REDIRECT_STATUS="200"
REDIRECT_URL="/index.html"
REMOTE_PORT="58361"
REQUEST_METHOD="GET"
REQUEST_URI="/"
SCRIPT_FILENAME="/disk/apache/apache2/cgi-bin/htmlhandler.pl"
SCRIPT_NAME="/cgi-bin/htmlhandler.pl"
SERVER_ADMIN="you@example.com"
SERVER_NAME="a.com"
SERVER_PORT="80"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE=""
SERVER_SOFTWARE="Apache/2.2.5-dev (Unix) mod_ssl/2.2.5-dev OpenSSL/0.9.8a DAV/2"

0

----------------------------------------------
For req2.txt  :

Date: Wed, 28 Mar 2007 00:01:26 GMT
Server: Apache/2.2.5-dev (Unix) mod_ssl/2.2.5-dev OpenSSL/0.9.8a DAV/2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

417
DOCUMENT_ROOT="/disk/apache/apache2/htdocs"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_CONNECTION="close"
HTTP_HOST="b.com"
LANG="en_US"
PATH=...
PATH_INFO="/index.html"
PATH_TRANSLATED="/disk/apache/apache2/htdocs/index.html"
QUERY_STRING="host=b"
REDIRECT_HANDLER="htmlhandler"
REDIRECT_QUERY_STRING="host=b"
REDIRECT_STATUS="200"
REDIRECT_URL="/index.html"
REMOTE_PORT="58362"
REQUEST_METHOD="GET"
REQUEST_URI="/"
SCRIPT_FILENAME="/disk/apache/apache2/cgi-bin/htmlhandler.pl"
SCRIPT_NAME="/cgi-bin/htmlhandler.pl"
SERVER_ADMIN="you@example.com"
SERVER_NAME="b.com"
SERVER_PORT="80"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE=""
SERVER_SOFTWARE="Apache/2.2.5-dev (Unix) mod_ssl/2.2.5-dev OpenSSL/0.9.8a DAV/2"

0
----------------------------------------------
Note that for various host query strings are different.

I believe the bug is invalid.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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