summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Cochrane <adrian@openwork.nz>2021-03-08 20:21:16 +1300
committerAdrian Cochrane <adrian@openwork.nz>2021-03-08 20:21:21 +1300
commit1e101982ae578cd6b2680baabad870860c1dbe30 (patch)
tree60cb536f81cce216ca9e40de41e37bf2226e1824
parent23bd2dfc2f021686f21b084d0bf4e5d3c669624d (diff)
downloadhurl-1e101982ae578cd6b2680baabad870860c1dbe30.tar.gz
hurl-1e101982ae578cd6b2680baabad870860c1dbe30.tar.bz2
hurl-1e101982ae578cd6b2680baabad870860c1dbe30.zip
Fix for more recent bytestring versions.
Otherwise it doesn't know which `strip` function to use...
-rw-r--r--src/Network/URI/Cache.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/URI/Cache.hs b/src/Network/URI/Cache.hs
index 908597f..179848d 100644
--- a/src/Network/URI/Cache.hs
+++ b/src/Network/URI/Cache.hs
@@ -23,11 +23,11 @@ import Data.List as L
import Control.Monad (forM, void, when)
import Text.Read (readMaybe)
-strip = C.dropWhile isSpace -- FIXME Upgrade bytestring dependency for a real strip function.
+stripBS = C.dropWhile isSpace -- FIXME Upgrade bytestring dependency for a real strip function.
httpCacheDirective :: Response b -> Strict.ByteString -> Maybe Strict.ByteString
httpCacheDirective response key | Just header <- lookup hCacheControl $ responseHeaders response =
- let directives = Prelude.map strip $ C.split ',' header
+ let directives = Prelude.map stripBS $ C.split ',' header
in if key `Prelude.elem` directives
then Just ""
else listToMaybe $ mapMaybe (C.stripPrefix $ C.snoc key '=') directives