Use renderHeader to render the Accept header
This commit is contained in:
parent
098b503625
commit
a23204e134
1 changed files with 1 additions and 3 deletions
|
@ -93,10 +93,8 @@ reqToRequest req (BaseUrl reqScheme reqHost reqPort) =
|
||||||
setheaders r = r { requestHeaders = requestHeaders r
|
setheaders r = r { requestHeaders = requestHeaders r
|
||||||
++ Prelude.map toProperHeader (headers req) }
|
++ Prelude.map toProperHeader (headers req) }
|
||||||
setAccept r = r { requestHeaders = filter ((/= "Accept") . fst) (requestHeaders r)
|
setAccept r = r { requestHeaders = filter ((/= "Accept") . fst) (requestHeaders r)
|
||||||
++ [("Accept", BS.intercalate ", " (map renderAccept $ reqAccept req))
|
++ [("Accept", renderHeader $ reqAccept req)
|
||||||
| not . null . reqAccept $ req] }
|
| not . null . reqAccept $ req] }
|
||||||
renderAccept :: MediaType -> BS.ByteString
|
|
||||||
renderAccept m = BSC.pack (show m)
|
|
||||||
toProperHeader (name, val) =
|
toProperHeader (name, val) =
|
||||||
(fromString name, encodeUtf8 val)
|
(fromString name, encodeUtf8 val)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue