More docs for pickContentType

This commit is contained in:
Joe Nelson
2015-11-18 23:56:59 -08:00
parent 8f04967103
commit 496cd77510
+8 -2
View File
@@ -112,8 +112,14 @@ userIntent schema req reqBody =
-- PRIVATE ---------------------------------------------------------------
-- | Chooses a payload from the items in an accept header.
-- When possible it picks JSON.
-- | Picks a preferred content type from an Accept header (or from
-- Content-Type as a degenerate case).
--
-- For example
-- text/csv -> TextCSV
-- */* -> ApplicationJSON
-- text/csv, application/json -> TextCSV
-- application/json, text/csv -> ApplicationJSON
pickContentType :: Maybe BS.ByteString -> Either BS.ByteString ContentType
pickContentType accept
| isNothing accept || has ctAll || has ctJson = Right ApplicationJSON