Respone Headers MIME-TYPE (CSS not working in IE9 - WeOnlyDo Discussion board

Respone Headers MIME-TYPE (CSS not working in IE9 (wodWebServer / wodWebServer.NET)

by Cyberlex, Thursday, May 09, 2013, 13:01 (4214 days ago)

Greetings!

I was doing some first tests with your Web Server component and I started using a very simple Web Server pointing to my file structure:

Imports WeOnlyDo.Server
..
Dim WithEvents mys As New WebServer
..
mys.DocumentRoot = C:tempwget
mys.DefaultPage = index.html
mys.ServerName = EWS
mys.BindIP = 192.168.1.5
mys.AllowBrowsing = True

My Index page contains both links to external .js and .css files to be included.

In IE8 it was displaying correctly, in IE9/10 it was not. IE in dev mode told me that the CSS got ignored (SEC7113: CSS was ignored due to mime type mismatch)

I then traced the answers your web component is composing with Wireshark and I saw that your auto-generated Response Headers do NOT contain the content-type . This is causing a Problem in IE9 and newer, as they changed the MIME type handling (read here, see SEC7113 in the table: http://msdn.microsoft.com/en-US/library/ie/hh180764(v=vs.85).aspx)

I worked around it by using your components RequestHeadersDoneEvent, Looping trough the args.user.request.headers to see if I can find a content-type Name/value. If yes, I manuall add the same mime type to the Response Header: Args.User.Response.Headers.Add( content-Type , <same as in request Header> )

To be honest I would actually expect your component to include the correct content-type in the Response Header to match the one in the request Header for any mime type.

Thank you very much & best regards,
Alex


Complete thread: