Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Firefox does not render HTML if Content-Type HTTP Header is missing

I work with Water Treatment Controllers which have embedded web servers. Some controller's that I try to connect to using Firefox do not render the HTML that is returned from the web server. Instead, Firefox (v11) displays the HTML as raw text. Other browsers (Chrome, IE, Safari) render the HTML fine. Firefox v2 rendered the HTML fine, too.

In troubleshooting the problem, I discovered that the controllers that Firefox do not render HTML for have invalid Response Headers. Specifically, the entire set of Response Headers is no more than...

200 OK

The Response Headers from the other controllers that Firefox correctly renders HTML look like...

Date: Mon, 6 Jan 2012 07:08:47 GMT 
Server: Z-World Rabbit 
Connection: close 
Content-Type: text/html

200 OK

It's obvious to me that Firefox is not rendering the HTML if/when the Response Header does not contain the Content-Type: text/html mime type field.

Since I am unable to change the Response Headers that are returned from the controllers, I would like to know if there is a setting in Firefox that will tell Firefox to render content as HTML even if the Content-Type: is missing from the Response Header.

share|improve this question

migrated from serverfault.com May 5 '12 at 2:15

This question came from our site for professional system and network administrators.

marked as duplicate by Bob, Chris S, studiohack May 5 '12 at 18:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
GreaseMonkey could be setup to fix the borked webpages too. –  Chris S May 5 '12 at 2:15
    
Your example isn't even valid HTTP. Looks like a badly implemented embedded server. What you need is a protocol droid... –  Keith May 5 '12 at 4:14
    
@ChrisS - The problem is not with the HTML content of the web page, but rather with the HTTP Header Fields (or the lack thereof). –  Jed May 5 '12 at 5:19
    
@Jed I understand that. HTML can set the content type and override the HTTP Header. GreaseMonkey can change the HTML and add the Content Type. W3-Schools has a good example of the tag, as always. I'm not savvy enough with GM to whip up a script, but it's only JavaScript and there are many similar examples around. –  Chris S May 5 '12 at 14:30
add comment

1 Answer

up vote 1 down vote accepted

Thanks to @ultrasawblade who answered this question here

The simple fix is to install the Firefox extension "Force Content-Type". Then, when adding a new rule, set the "Old Content-Type" to the regular expression "\S" (I use this RE because the original HTTP Header didn't include a "Content-Type" field).

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.