On Feb 22, 2004, at 7:25 PM, Trey Campbell wrote:

> Trying it with the following:
>
> #!C:/ruby/bin/ruby.exe
> print "Content-type: text/plain\n\n"
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
>
> Mozilla renders the page (as if it encountered a <pre> tag). IE shows 
> a dialog offering to run the associated application (but warning that 
> it might not be a good idea to do so). I wouldn't characterize that as 
> misbehaving since that's what I'd expect it to do, or at least offer 
> to do; it's just doing a better job of recognizing potential helper 
> applications than Mozilla is.

The mime type is there for a reason. When a file is downloaded, the 
browser is supposed to look at the mime type to figure out what to do. 
If the mime-type is "image/jpeg", that means it's jpeg image, despite 
the fact that it's filename might be "graph.rb" (if it happens to be a 
dynamically created image). A mime type of "text/plain" indicates a 
simple plaintext file, which should be rendered on the screen. The 
browser should NOT try to execute it. If it should be executed, it 
should have a mime type of, I don't know, "executable/ruby" or 
something. If the browser can't recognize the mime type, *then* it 
should feel free to try to figure it out.

A windows pc determines filetypes based on the extension, a mac 
primarily uses the creatorcode and typecode metadata, a unix box uses 
(mostly, i think) magic numbers. All Things Web are supposed to use 
mime types as a bridge. This is to ensure that things like, say, a 
plaintext file, don't get interpreted as, say, an executable ruby 
script.

um.... okay. I'll stop my "standards rant" now.

-Mark