From 1e101982ae578cd6b2680baabad870860c1dbe30 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Mon, 8 Mar 2021 20:21:16 +1300 Subject: [PATCH] Fix for more recent bytestring versions. Otherwise it doesn't know which `strip` function to use... --- src/Network/URI/Cache.hs | 4 ++-- 1 file 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 -- 2.30.2