Response.ContentType is mutually changing for IE8 using ASP.NET MVC

We are running ASP.NET MVC on IIS6. We started to notice a problem with IE8 clients. Almost all the time, ContentType returns "text / html", but sometimes it will be returned as "application / xhtml + xml". This causes IE8 to try to download the file rather than displaying the content in browsers.

I can not find the reason for the change in ContentType. Requests from the browser look the same.

  • Where is the ContentType installed in the ASP.NET/MVC pipeline?
  • Any ideas that might trigger specific requests to modify ContentType?

Updated Information

  • We use the default ViewEngine, equipped with MVC infrastructure.
  • This happens on multiple machines.
0
asp.net-mvc iis
source share
1 answer

It looks like someone is trying to change the content type based on the User-Agent request header; sending text / html to IE because it does not support XHTML.

If so, there may be an intermediate (proxy) server that serves to respond to another UA. Check the response headers for Cache-Control and Vary.

0
source share

All Articles