https://bugzilla.redhat.com/show_bug.cgi?id=1513173
Bug ID: 1513173
Summary: Review Request: ghc-http-media - Processing HTTP
Content-Type and Accept headers
Product: Fedora
Version: rawhide
Component: Package Review
Severity: medium
Priority: medium
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Spec URL:
https://raw.githubusercontent.com/weldr/bdcs-copr/master/ghc-http-media/ghc-http-media.spec
SRPM URL:
https://copr-be.cloud.fedoraproject.org/results/@weldr/bdcs-haskell-deps/fedora-27-x86_64/00611292-ghc-http-media/ghc-http-media-0.7.1.1-1.fc27.src.rpm
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.
Fedora Account System Username: dshea
--
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- [email protected]
To unsubscribe send an email to [email protected]