markrendle/Simple.Web — pull request #60 by tapmantwo (2013-07-17 14:07:41+00:00)
Title: Media Type resolution failing for wildcard matches in MediaTypeHandlerEx.GetContentType

In our handlers, we have a LinksFrom attribute on the handlers which specifies the media type of the entity.

When making our GET requests, we wish to specify this media type in our Accept header. However, this fails - because the response Content-Type is never set and an exception is thrown.

The JSONFX handler (which is the one we are using) has a wild card media type listed in it's MediaTypes attribute, and this should match the value passed in the Accept header - but at the moment it does an equality comparison.

So this change was to handle wild card headers and check whether they match the specified media type.