views:

178

answers:

2

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.

+1  A: 

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.

databyte
A: 

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