views:

147

answers:

1

We are running ASP.NET MVC on IIS6. We have started to notice a problem with IE8 clients. Almost all the time, the ContentType returned is 'text/html' but occasionally, it will be returned as 'application/xhtml+xml'. This is causing IE8 to try and download the file instead of rendering the contents in the browsers.

I can't find any reason for the ContentType to change. The requests from the browser look the same.

  1. Where is the ContentType set in the ASP.NET/MVC pipeline?
  2. Any ideas what might be causing certain requests to change the ContentType?

Updated Information

  • We are using the default ViewEngine provided with the MVC framework.
  • This is happening on multiple machines.
A: 

It sounds like somebody is trying to vary the content-type based on the User-Agent request header; sending text/html to IE because it doesn't support XHTML.

If this is the case, maybe there's an intermediate (proxy) serving you a response for a different UA. Check Cache-Control and Vary response headers.

Julian Reschke
There's no proxy between the clients and the server. They are the same network.
LaptopHeaven