spray/spray — pull request #325 by sirthias (2013-06-19 10:33:48+00:00)
Title: #310: http: add support for Accept-Header extensions and media-type parameters

Apart from adding another member to the MediaType and MediaRange case class models
(`parameters: Map[String, String]`) this patch also fixes an inconsistency in API design.
For the `HttpCharset` and `HttpEncoding` type you create a custom model instance with
the `custom` method defined on the `HttpCharset` or `HttpEncoding` companion object,
e.g. `HttpCharset.custom("foo")`.
For media-types the `custom` method was defined on the `MediaTypes` object. This has
been changed, you now create a custom media-type with `MediaType.custom`.

Note that quality value (e.g. `q=.2`) on media-range definitions in an `Accept` header are
still not supported in content negotiation. Since we don't want the existence of quality
values in request `Accept` headers to trigger the creation of custom (unregistered)
MediaRange or MediaType instances (which would come with performance penalty due to
not reusing registered instances) we filter the `q` values out of the parameters list.
You therefore won't find them in the `parameters` map.