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

3

1

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.

Jed

Posted 2012-05-04T23:16:03.540

Reputation: 315

Answers

4

Try this addon called "Force Content-Type" - I haven't tested it myself but it seems to do what you need.

LawrenceC

Posted 2012-05-04T23:16:03.540

Reputation: 63 487

1Force Content-Type does the job! For the record, since the original HTTP Headers did not contain a Content-Type field, when adding a new rule in the Force Content-Type extension, I had to specify the regular expression "\S" as the "Old Content-Type". – Jed – 2012-05-05T14:17:01.217