Note that there are some explanatory texts on larger screens.

plurals
  1. POtclhttpd.3.5.1 shows page source (Windows)
    primarykey
    data
    text
    <p>I am playing with tclhttpd web server and found a strange error</p> <ol> <li>I start tclhttpd at default port 8015</li> <li>Open firefox and navigate to <a href="http://localhost:8015" rel="nofollow">http://localhost:8015</a></li> </ol> <p>I see source of my index.html file instead of web page.</p> <p>index.html is simple ( &lt; and > are skipped ):</p> <pre><code> html head title TEST /title /head body H1 TEST HEADER /H1 /body /html </code></pre> <p>Any ideas?</p> <p>I have checked with the curl:</p> <pre><code>* About to connect() to localhost port 8015 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8015 (#0) &gt; GET / HTTP/1.1 &gt; User-Agent: curl/7.21.3 (i386-pc-win32) libcurl/7.21.3 OpenSSL/0.9.8q zlib/1.2.5 &gt; Host: localhost:8015 &gt; Accept: */* </code></pre> <p>Server Response</p> <pre><code> HTTP/1.1 200 Data follows Date: Thu, 12 Apr 2012 14:16:47 GMT Server: Tcl-Webserver/3.5.1 May 27, 2004 Content-Type: text/plain Content-Length: 130 Last-Modified: Thu, 12 Apr 2012 14:14:30 GMT </code></pre> <p>So, tclhttpd returns text/plain instead of text/html</p> <p><strong>Linux case</strong></p> <p>I have tried to check what would happened with Linux.</p> <p>As tclkttpd is wrapped in kit I made the same test under Linux. It looks like everything works fine. </p> <p>curl -G -v localhost:8015</p> <pre><code>* About to connect() to localhost port 8015 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8015 (#0) &gt; GET / HTTP/1.1 &gt; User-Agent: curl/7.21.7 (i686-pc-linux-gnu) libcurl/7.21.7 OpenSSL/1.0.0d zlib/1.2.5 libssh2/1.2.7 &gt; Host: localhost:8015 &gt; Accept: */* </code></pre> <p>Server response</p> <pre><code> HTTP/1.1 200 Data follows Date: Thu, 12 Apr 2012 17:25:29 GMT Server: Tcl-Webserver/3.5.1 May 27, 2004 Content-Type: text/html Content-Length: 125 Last-Modified: Thu, 12 Apr 2012 17:14:04 GMT </code></pre> <p><strong>Deep research</strong></p> <p>I have modified some of the source files, to dump more information:</p> <pre><code>proc Mtype {path} { global MimeType set ext [string tolower [file extension $path]] Stderr "Mtype: path $path ext $ext" if {[info exist MimeType($ext)]} { Stderr "MimeType($ext) exists." Stderr "Print MimeType " set lst [lsort [array names MimeType]] foreach {i} $lst { Stderr " $i $MimeType($i)" } return $MimeType($ext) } else { Stderr "Mimetype not found. ext $ext" Stderr "Print MimeType " set lst [lsort [array names MimeType]] foreach {i} $lst { Stderr " $i $MimeType($i)" } return text/plain } } </code></pre> <p>When I query <a href="http://localhost:8015" rel="nofollow">http://localhost:8015</a> I got following output:</p> <ul> <li>Linux</li> </ul> <pre> Mtype: path /home/a2/src/tcl/tcl_www/doc/index.html ext .html MimeType(.html) exists. Print MimeType text/plain .ai application/postscript .aif audio/x-aiff .aifc audio/x-aiff .... .hqx application/mac-binhex40 .htm text/html .html text/html .i86pc application/octet-stream ... Default cmd Doc_text/html </pre> <ul> <li>Windows</li> </ul> <pre> Look for Tcl proc whos name match the MIME Content-Type Mtype: path M:/apr/tcl_www/doc/index.html ext .html Mimetype not found. ext .html Print MimeType .man application/x-doctool Mtype M:/apr/tcl_www/doc/index.html returns Doc_text/plain </pre> <p>So it look like there are troubles with reading mime.types</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload