[Haskell-cafe] viewing HS files in Firefox
r.kelsall at millstream.com
Tue Oct 30 14:14:19 EDT 2007
Jules Bean wrote:
> Isaac Dupree wrote:
>> When I try to go to one of the Module.hs files, e.g. on
>> darcs.haskell.org, it now has type HS and Firefox refuses to display
>> it (and only lets me download it). Does anyone know how to make
>> Firefox treat certain file types as others (HS as plain text, in
>> particular)? so that I can browse them with any convenience
> It is really annoying, and it is an astoundingly old bug in firefox.
> Apparently it's very hard to fix due to annoying details of the firefox
> It would be simplest for everyone if haskell.org was prepared to send
> out the files as text/plain (even though this is the wrong mime type),
> as I believe it used to do.
Yes, it does appear to be a bug in Firefox
not to attempt to display text/x-haskell as if it were text/plain,
but to get really obsessive I'm not convinced text/plain is strictly
speaking the 'wrong' media-type if that's what the user-agent requests.
For example, my FireFox 22.214.171.124 says to the server it will Accept these
text/xml, application/xml, application/xhtml+xml, text/html; q=0.9,
This is in order of what it would most like to get back from the server.
The server then goes off and tries to find the best media-type for my
browser - it can supply different ones depending on what the browser
says it wants. By returning it as text/x-haskell the server has given
the resource to my browser in */* which is the least wanted media-type.
This is perfectly correct behaviour, but if the server was also capable
of providing the same thing as text/plain it would be better to give
this, or even better a pretty coloured text/html one if the server had
one available. I think the underlying file returned as text/x-haskell
or text/plain can be the exact same file assuming all x-haskell are
Could be wrong, but that's my understanding of content negotiation.
More information about the Haskell-Cafe