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 (4004 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

Re: Respone Headers MIME-TYPE (CSS not working in

by Cyberlex, Thursday, May 09, 2013, 13:36 (4004 days ago) @ Cyberlex

just realise using the same mime-type as the request Header is causeing other issues lol :) just doing it for the text/css, then it works

Re: Respone Headers MIME-TYPE (CSS not working in

by Cyberlex, Thursday, May 09, 2013, 13:41 (4004 days ago) @ Cyberlex

and this post should go into wodWebServer, Boy not my day today! lol :)

Re: Respone Headers MIME-TYPE (CSS not working in

by woddrazen, Thursday, May 09, 2013, 14:14 (4004 days ago) @ Cyberlex

Hi,


If I understand correctly component works now as expected. We are glad to receive such good news.

If you still need help let us know and we will try to help you.


Regards,
Drazen

Re: Respone Headers MIME-TYPE (CSS not working in

by Cyberlex, Friday, May 10, 2013, 11:12 (4003 days ago) @ woddrazen

yes it works just fine thanks, thought I post it here so others can leverage

Re: Respone Headers MIME-TYPE (CSS not working in

by woddrazen, Friday, May 10, 2013, 11:15 (4003 days ago) @ Cyberlex

Hi,


OK thanks for sharing this with us.

If you find some problem please don't hesitate to ask. We are here to help you.


Drazen