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)