summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Alper Nebi Yasak <alpernebiyasak@gmail.com>2016-12-10 15:24:27 +0300
committerGravatar Joey Hess <joeyh@joeyh.name>2016-12-10 10:45:52 -0400
commitcb5724155e20f247c3d4a987aa6635a8e5de039a (patch)
treeb830e7f95dfc538c7745d0353f0a098a11df7944 /Utility
parentd7b969b0835e7a2b5046c62b7f40a4089c4cc760 (diff)
Remove http-conduit (<2.2.0) constraint
Since https://github.com/aristidb/aws/issues/206 is resolved, this constraint is no longer necessary. However, http-conduit (>=2.2.0) requires http-client (>=0.5.0) which introduces some breaking changes. This commit also implements those changes depending on the version. Fixes: https://git-annex.branchable.com/bugs/Build_with_aws_head_fails/ Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Url.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs
index 9b68871dd..d0e1b3739 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -350,8 +350,16 @@ hUserAgent = "User-Agent"
-
- > catchJust (matchStatusCodeException (== notFound404))
-}
+#if MIN_VERSION_http_client(0,5,0)
+matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
+matchStatusCodeException want e@(HttpExceptionRequest _ (StatusCodeException r _))
+ | want (responseStatus r) = Just e
+ | otherwise = Nothing
+matchStatusCodeException _ _ = Nothing
+#else
matchStatusCodeException :: (Status -> Bool) -> HttpException -> Maybe HttpException
matchStatusCodeException want e@(StatusCodeException s _ _)
| want s = Just e
| otherwise = Nothing
matchStatusCodeException _ _ = Nothing
+#endif