summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-10 11:26:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-10 11:26:30 -0400
commit1a8eb3334f70065d281c7c798c1172ee5f56c941 (patch)
tree77e06d06e66c9a52b542c2466104de7b32fe2815 /Utility
parent60af69bc6e7d3c35da8455f41c1c42d2b76ec491 (diff)
deal with incompatable api change in network 2.4.0.1
On the cabal side, let's just require this new version, and set -DURI_24 to enable the code using it.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Url.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs
index b75229e1b..6a45c559c 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.Url (
URLString,
check,
@@ -108,6 +110,10 @@ request url headers requesttype = go 5 url
Nothing -> return rsp
Just newURI -> go n newURI_abs
where
+#ifdef URI_24
+ newURI_abs = newURI `relativeTo` u
+#else
newURI_abs = fromMaybe newURI (newURI `relativeTo` u)
+#endif
addheaders req = setHeaders req (rqHeaders req ++ userheaders)
userheaders = rights $ map parseHeader headers