git.iko.soy/typeable/servant
on master help sign in
Fix issue #821
3fedbd0Joshua McCartney
servant-client/src/Servant/Client/Internal/HttpClient.hs+4
@@ -136,12 +136,16 @@ requestToClientRequest burl r = Client.defaultRequest
136 let orig = toList $ requestHeaders r
136 let orig = toList $ requestHeaders r
137 in maybe orig (: orig) contentTypeHdr
137 in maybe orig (: orig) contentTypeHdr
138 , Client.requestBody = body
138 , Client.requestBody = body
139+ , Client.secure = isSecure
139 }
140 }
140 where
141 where
141 (body, contentTypeHdr) = case requestBody r of
142 (body, contentTypeHdr) = case requestBody r of
142 Nothing -> (Client.RequestBodyLBS "", Nothing)
143 Nothing -> (Client.RequestBodyLBS "", Nothing)
143 Just (RequestBodyLBS body', typ)
144 Just (RequestBodyLBS body', typ)
144 -> (Client.RequestBodyLBS body', Just (hContentType, renderHeader typ))
145 -> (Client.RequestBodyLBS body', Just (hContentType, renderHeader typ))
146+ isSecure = case baseUrlScheme burl of
147+ Http -> False
148+ Https -> True
145
149
146catchConnectionError :: IO a -> IO (Either ServantError a)
150catchConnectionError :: IO a -> IO (Either ServantError a)
147catchConnectionError action =
151catchConnectionError action =