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 2002/04/11 17:08:20 UTC

DO NOT REPLY [Bug 7966] New: - Wrong Content-Length when SSI used as DirectoryIndex

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=7966>.
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=7966

Wrong Content-Length when SSI used as DirectoryIndex

           Summary: Wrong Content-Length when SSI used as DirectoryIndex
           Product: Apache httpd-2.0
           Version: 2.0.35
          Platform: PC
               URL: http://www.nanvaent.org:81/
        OS/Version: FreeBSD
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: apache-bugzilla@kolbu.com


In some cases, the Content-Length used remains the length of the file on disk, even though the 
content of the file is changed by SSIs before transfer to client. This happens only when the file in 
question is used as a DirectoryIndex, i.e. http://www.nanvaent.org:81/. If explicitly gotten, i.e. 
http://www.nanvaent.org:81/oktest.shtml, it transfers fine (presumably because the server does not 
include a Content-Length: header in that case). 
 
The weird part is that _sometimes_ it actually works... 
 
Example: 
 
In httpd.conf: 
DirectoryIndex oktest.shtml 
AddType text/html .shtml 
AddOutputFilter INCLUDES .shtml 
 
 
 
File /cgi-bin/oktest.cgi 
--- cut here --- 
#!/bin/sh 
echo Content-Type: text/html 
echo 
echo TeSt 
--- cut here --- 
 
File /oktest.shtml   (Note, 54 bytes long) 
--- cut here --- 
<html> 
<!--#exec cgi="/cgi-bin/oktest.cgi"--> 
</html> 
--- cut here --- 
 
Some tests with wget, the first one explicitly asking for the file: 
 
strider tmp # wget -O - -S http://www.nanvaent.org:81/oktest.shtml 
--16:57:45--  http://www.nanvaent.org:81/oktest.shtml 
           => `-' 
Resolving www.nanvaent.org... done. 
Connecting to www.nanvaent.org[194.70.3.222]:81... connected. 
HTTP request sent, awaiting response... 
 1 HTTP/1.1 200 OK 
 2 Date: Thu, 11 Apr 2002 14:57:45 GMT 
 3 Server: Apache/2.0.35 (Unix) PHP/4.3.0-dev mod_ssl/2.0.35 OpenSSL/0.9.6a 
 4 Accept-Ranges: bytes 
 5 Connection: close 
 6 Content-Type: text/html; charset=ISO-8859-1 
 
    [<=>                                  ] 0             --.--K/s             <html> 
TeSt 
 
</html> 
    [ <=>                                 ] 21            20.51K/s 
 
16:57:45 (20.51 KB/s) - `-' saved [21] 
 
 
Second test, just asking for the directory: 
strider tmp # wget -O - -S http://www.nanvaent.org:81/ 
--16:59:42--  http://www.nanvaent.org:81/ 
           => `-' 
Resolving www.nanvaent.org... done. 
Connecting to www.nanvaent.org[194.70.3.222]:81... connected. 
HTTP request sent, awaiting response... 
 1 HTTP/1.1 200 OK 
 2 Date: Thu, 11 Apr 2002 14:59:42 GMT 
 3 Server: Apache/2.0.35 (Unix) PHP/4.3.0-dev mod_ssl/2.0.35 OpenSSL/0.9.6a 
 4 Last-Modified: Thu, 11 Apr 2002 14:40:25 GMT 
 5 ETag: "364ce-36-65f60840" 
 6 Accept-Ranges: bytes 
 7 Content-Length: 54 
 8 Keep-Alive: timeout=15, max=200 
 9 Connection: Keep-Alive 
10 Content-Type: text/html; charset=ISO-8859-1 
 
 0% [                                     ] 0             --.--K/s    ETA --:--<html> 
TeSt 
 
</html> 
38% [=============>                       ] 21            20.51K/s    ETA 00:00 
 
16:59:57 (20.51 KB/s) - Connection closed at byte 21. Retrying. 
 
etc etc 
 
Note the Content-Length header.