From a23204e134eae0e9759e866a04b624c497aa7d6e Mon Sep 17 00:00:00 2001 From: Timo von Holtz Date: Tue, 17 Feb 2015 12:23:03 +1100 Subject: [PATCH] Use renderHeader to render the Accept header --- src/Servant/Common/Req.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Servant/Common/Req.hs b/src/Servant/Common/Req.hs index 09ea2b03..d6243f6c 100644 --- a/src/Servant/Common/Req.hs +++ b/src/Servant/Common/Req.hs @@ -93,10 +93,8 @@ reqToRequest req (BaseUrl reqScheme reqHost reqPort) = setheaders r = r { requestHeaders = requestHeaders r ++ Prelude.map toProperHeader (headers req) } setAccept r = r { requestHeaders = filter ((/= "Accept") . fst) (requestHeaders r) - ++ [("Accept", BS.intercalate ", " (map renderAccept $ reqAccept req)) + ++ [("Accept", renderHeader $ reqAccept req) | not . null . reqAccept $ req] } - renderAccept :: MediaType -> BS.ByteString - renderAccept m = BSC.pack (show m) toProperHeader (name, val) = (fromString name, encodeUtf8 val)