Fix issue #821
This commit is contained in:
parent
4a6edd7864
commit
3fedbd097a
1 changed files with 4 additions and 0 deletions
|
@ -136,12 +136,16 @@ requestToClientRequest burl r = Client.defaultRequest
|
||||||
let orig = toList $ requestHeaders r
|
let orig = toList $ requestHeaders r
|
||||||
in maybe orig (: orig) contentTypeHdr
|
in maybe orig (: orig) contentTypeHdr
|
||||||
, Client.requestBody = body
|
, Client.requestBody = body
|
||||||
|
, Client.secure = isSecure
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
(body, contentTypeHdr) = case requestBody r of
|
(body, contentTypeHdr) = case requestBody r of
|
||||||
Nothing -> (Client.RequestBodyLBS "", Nothing)
|
Nothing -> (Client.RequestBodyLBS "", Nothing)
|
||||||
Just (RequestBodyLBS body', typ)
|
Just (RequestBodyLBS body', typ)
|
||||||
-> (Client.RequestBodyLBS body', Just (hContentType, renderHeader 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 :: IO a -> IO (Either ServantError a)
|
||||||
catchConnectionError action =
|
catchConnectionError action =
|
||||||
|
|
Loading…
Reference in a new issue