Re: server setting the content-type

Jon E. Mittelhauser (jonm@ncsa.uiuc.edu)
Thu, 30 Dec 93 12:58:34 CST


>- In mosaic, an HTML file named "foo" will display as
>formatted text if it contains a <TITLE> tag.

This is only true of the X-Windows version (and maybe Mac) and is the result of
a hack that Marc threw in back in HTTP/0.9 days. In my opinion,
it is a bug and I have told Marc and Eric such. The windows
version does not try to out-guess the server. If a HTTP/1.0 server
returns type text/plain, we display it as plain text even if it
contains HTML. I consider this to be the correct behavior. The
upshot, of course, is that we repeatedly get bug reports that "this
file works in the X-version but not in the windows version". The fact
is, the server is telling us that it is plain text so we are displaying
it as such.

>- In lynx, such a file will be interpreted as text and
>display the HTML tags. In order for it to be shown as
>formatted text, I had to change my server's srm.conf file to:
>
>DefaultType text/html

This is the correct behavior. The server in (HTTP/1.0) should be
doing all the typing. This enables a person to put a document up
that shows source HTML via typing it as text/plain. The X version
of Mosaic will always display it as formatted HTML...

>so that the delivered document has the proper Content-type
>header for HTML. But that means text files will be
>interpreted as HTML also and not display properly.

>We have good reasons not to add ".html" to each
>HTML document, but we also don't want to add .txt
>to every text document.

If you have files with identical extensions, you are going to have to
tell the server on a file (or directory) basis what the type is...

-Jon

---
Jon E. Mittelhauser (jonm@ncsa.uiuc.edu)
Research Programmer, NCSA                          (NCSA Mosaic for MS Windows)
More info <a href="http://www.ncsa.uiuc.edu/SDG/People/jonm/jonm.html">here</a>