hxt-curl 9.1.0 → 9.1.1
raw patch · 2 files changed
+26/−20 lines, 2 filesdep −haskell98PVP ok
version bump matches the API change (PVP)
Dependencies removed: haskell98
API changes (from Hackage documentation)
Files
- hxt-curl.cabal +1/−2
- src/Text/XML/HXT/IO/GetHTTPLibCurl.hs +25/−18
hxt-curl.cabal view
@@ -1,6 +1,6 @@ -- arch-tag: Haskell XML Toolbox main description file Name: hxt-curl-Version: 9.1.0+Version: 9.1.1 Synopsis: LibCurl interface for HXT Description: LibCurl interface for HXT License: OtherLicense@@ -30,7 +30,6 @@ extensions: build-depends: base >= 4 && < 5,- haskell98 >= 1 && < 2, parsec >= 2.1 && < 4, bytestring >= 0.9 && < 1, curl >= 1.3 && < 2,
src/Text/XML/HXT/IO/GetHTTPLibCurl.hs view
@@ -72,8 +72,8 @@ initCurl = do i <- takeMVar isInitCurl- when (not i) ( do- _ <- curl_global_init 3+ when (not i) ( curl_global_init 3+ >> return () ) putMVar isInitCurl True@@ -182,25 +182,26 @@ statusLine (words rsl) contentT- = map (first stringToLower) -- all header names to lowercase- >>>- filter ((== "content-type") . fst) -- select content-type header+ = map (first stringToLower) -- all header names to lowercase >>>- reverse -- when libcurl is called with automatic redirects, there are more than one content-type headers+ filter ((== "content-type") . fst) -- select content-type header >>>- take 1 -- take the last one, (if at leat one is found)+ reverse -- when libcurl is called with automatic redirects,+ >>> -- there are more than one content-type headers+ take 1 -- take the last one, (if at leat one is found) >>>- map snd -- select content-type value+ map snd -- select content-type value >>> map ( either (const []) id- . parse parseContentType "" -- parse the content-type for mimetype and charset+ . parse parseContentType "" -- parse the content-type for mimetype and charset ) >>> concat - statusLine (vers : _code : msg) -- the status line of the curl response can be an old one, e.g. in the case of a redirect,- = [ mkH transferVersion vers -- so the return code is taken from the status field, which is contains the last status- , mkH transferMessage $ unwords msg+ statusLine (vers : _code : msg) -- the status line of the curl response can be an old one, + -- e.g. in the case of a redirect,+ = [ mkH transferVersion vers -- so the return code is taken from that status field,+ , mkH transferMessage $ unwords msg -- which is contains the last status , mkH transferStatus $ show rs ] statusLine _@@ -235,8 +236,10 @@ | k `elem` ["-H", "header"] = [CurlHttpHeaders $ lines v] | k == "ignore-content-length" = [CurlIgnoreContentLength $ isTrue v] | k `elem` ["-I", "head"] = [CurlNoBody $ isTrue v]- | k `elem` ["-L", "location", a_redirect]- = [CurlFollowLocation $ isTrue v]+ | k `elem` [ "-L"+ , "location"+ , a_redirect+ ] = [CurlFollowLocation $ isTrue v] | k == "max-filesize" && isIntArg v = [CurlMaxFileSizeLarge $ read v]@@ -250,8 +253,10 @@ | k `elem` ["-R", "remote-time"] = [CurlFiletime $ isTrue v] | k `elem` ["-u", "user"] = [CurlUserPwd v] | k `elem` ["-U", "proxy-user"] = [CurlProxyUserPwd v]- | k `elem` ["-x", "proxy", a_proxy]- = proxyOptions+ | k `elem` [ "-x"+ , "proxy"+ , a_proxy+ ] = proxyOptions | k `elem` ["-X", "request"] = [CurlCustomRequest v] | k `elem` ["-y", "speed-time"] &&@@ -262,8 +267,10 @@ | k == a_if_modified_since = [CurlHttpHeaders $ ["If-Modified-Since: " ++ v] ] | k == a_if_unmodified_since = [CurlHttpHeaders $ ["If-Unmodified-Since: " ++ v] ] -- CurlTimeValue seems to be buggy, therefore the above workaround- | k `elem` ["-z", "time-cond", a_if_modified_since]- = ifModifiedOptions+ | k `elem` [ "-z"+ , "time-cond"+ , a_if_modified_since+ ] = ifModifiedOptions | k == "max-redirs" &&