Skip to content

Commit

Permalink
Minor code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Feb 20, 2024
1 parent c131f8d commit b103792
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Text/Pandoc/Class/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,12 @@ openURL u
disableCertificateValidation <- getsCommonState stNoCheckCertificate
report $ Fetching u
res <- liftIO $ E.try $ withSocketsDo $ do
let parseReq = parseRequest
proxy <- tryIOError (getEnv "http_proxy")
let addProxy' x = case proxy of
Left _ -> return x
Right pr -> parseReq pr >>= \r ->
Right pr -> parseRequest pr >>= \r ->
return (addProxy (host r) (port r) x)
req <- parseReq (unpack u) >>= addProxy'
req <- parseRequest (unpack u) >>= addProxy'
let req' = req{requestHeaders = customHeaders ++ requestHeaders req}
let tlsSimple = TLSSettingsSimple disableCertificateValidation False False
let tlsManagerSettings = mkManagerSettings tlsSimple Nothing
Expand Down

0 comments on commit b103792

Please sign in to comment.