Merge pull request #822 from limaner2002/issue-821

Fix issue #821
This commit is contained in:
Julian Arni 2017-10-02 09:30:11 -07:00 committed by GitHub
commit 63d8f6c0f3

View file

@ -136,12 +136,16 @@ requestToClientRequest burl r = Client.defaultRequest
let orig = toList $ requestHeaders r
in maybe orig (: orig) contentTypeHdr
, Client.requestBody = body
, Client.secure = isSecure
}
where
(body, contentTypeHdr) = case requestBody r of
Nothing -> (Client.RequestBodyLBS "", Nothing)
Just (RequestBodyLBS body', typ)
-> (Client.RequestBodyLBS body', Just (hContentType, renderHeader typ))
isSecure = case baseUrlScheme burl of
Http -> False
Https -> True
catchConnectionError :: IO a -> IO (Either ServantError a)
catchConnectionError action =