3

I was serving html referencing svg files in Cassini, and having problems since the mime type was not being sent properly. I ended up writing my own port of Cassini that set the extension based on mime type.

After a good night of sleep I realized that there might be some sort of registry key or config file where I can configure custom mime types for SimpleWorkerRequest, the .NET class that serves content through Casinni. However, I don't know what that is.

Community
  • 1
  • 1
Justin Dearing
  • 14,270
  • 22
  • 88
  • 161
  • 1
    Don’t know if this might help but SysInternals [ http://technet.microsoft.com/en-us/sysinternals/default.aspx ] will show you all the file I/O and registry I/O the Hosting Assembly is doing. Plus Reflector may help with the System.Web.Hosting assemblies. – kervin Apr 05 '10 at 13:55
  • Zippy I presume. I will take a look at the MIME type issues tonight r.e. CassiniDev. Thanks for the reference point. – Sky Sanders May 16 '10 at 04:57
  • OK, I deleted my answer because when I added mime types to my test suite WebDev fails - i.e. `application/octet-stream` for svg. In CassiniDev I folded in your fixes and while not optimal, neither is the MS implementation so what can you do? Looks like a big switch is coming to cassinidev and falling through to a call to UrlMon in the default. (UrlMon identifies .svg as text/xml). Thanks for the headsup. – Sky Sanders May 16 '10 at 06:21
  • Hey - check http://cassinidev.codeplex.com/WorkItem/View.aspx?WorkItemId=12506 for some info on your fix. – Sky Sanders May 16 '10 at 06:34
  • Justin, I just released a VS compatible build that you can use in debugging. Source is coming soon. http://skysanders.net/subtext/archive/2010/05/22/release-cassinidev-for-visual-studio-2008-a-drop-in.aspx – Sky Sanders May 22 '10 at 18:23

2 Answers2

1

I'm fairly certain you'll have to be responsible for identifying and then sending the proper MIME types via the response headers using SimpleWorkerRequest.SendKnownResponseHeader.

A basic implementation and discussion of this can be found on this blog post.

Now if you'd like to reimplement IIS' list of MIME types, IIS stores its own list in the metabase (and subsequent XML). A previous stackoverflow question highlights how to access that list and where to pull it from.

Community
  • 1
  • 1
databyte
  • 1,228
  • 10
  • 7
0

If you don't want to re-implement, or just want to copy the list, there is a list of mime types included with the default installation of the Neokernel Web Server (http://www.neokernel.com) and the server can be easily configured to support different or custom mime types by updating the list.

Damien
  • 676
  • 3
  • 8