-------------------------------------------------------------------------------- Fedora Update Notification FEDORA-2017-883b66b201 2017-11-28 22:04:39.404058 --------------------------------------------------------------------------------
Name : ghc-http-media Product : Fedora 27 Version : 0.7.1.1 Release : 1.fc27 URL : https://hackage.haskell.org/package/http-media Summary : Processing HTTP Content-Type and Accept headers Description : This library is intended to be a comprehensive solution to parsing and selecting quality-indexed values in HTTP headers. It is capable of parsing both media types and language parameters from the Accept and Content header families, and can be extended to match against other accept headers as well. Selecting the appropriate header value is achieved by comparing a list of server options against the quality-indexed values supplied by the client.
In the following example, the Accept header is parsed and then matched against a list of server options to serve the appropriate media using 'mapAcceptMedia':
getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia > [
("text/html", asHtml) > , ("application/json", asJson) > ]
Similarly, the Content-Type header can be used to produce a parser for request bodies based on the given content type with 'mapContentMedia':
getContentType >>= maybe send415Error readRequestBodyWith .
mapContentMedia > [ ("application/json", parseJson) > , ("text/plain", parseText) > ]
The API is agnostic to your choice of server.
-------------------------------------------------------------------------------- Update Information:
New package ghc-http-media -------------------------------------------------------------------------------- References:
[ 1 ] Bug #1513173 - None https://bugzilla.redhat.com/show_bug.cgi?id=1513173 --------------------------------------------------------------------------------
This update can be installed with the "dnf" update program. Use su -c 'dnf upgrade ghc-http-media' at the command line. For more information, refer to the dnf documentation available at http://dnf.readthedocs.io/en/latest/command_ref.html#upgrade-command-label
All packages are signed with the Fedora Project GPG key. More details on the GPG keys used by the Fedora Project can be found at https://fedoraproject.org/keys --------------------------------------------------------------------------------