on master help sign in
Merge pull request #822 from limaner2002/issue-821

Fix issue #821

commit63d8f6c0f3fb20b507fb435f18fad11923a38cc2 authorJulian Arni <jkarni@gmail.com> dateMon 2 Oct 2017, 09:30 (9 years ago) parent6e431d53fedbd0
1 file changed+4
servant-client/src/Servant/Client/Internal/HttpClient.hs+4
servant-client/src/Servant/Client/Internal/HttpClient.hs+4
@@ -136,12 +136,16 @@ requestToClientRequest burl r = Client.defaultRequest
136136 let orig = toList $ requestHeaders r
137137 in maybe orig (: orig) contentTypeHdr
138138 , Client.requestBody = body
139+ , Client.secure = isSecure
139140 }
140141 where
141142 (body, contentTypeHdr) = case requestBody r of
142143 Nothing -> (Client.RequestBodyLBS "", Nothing)
143144 Just (RequestBodyLBS body', typ)
144145 -> (Client.RequestBodyLBS body', Just (hContentType, renderHeader typ))
146+ isSecure = case baseUrlScheme burl of
147+ Http -> False
148+ Https -> True
145149
146150catchConnectionError :: IO a -> IO (Either ServantError a)
147151catchConnectionError action =