~alcinnz/hurl

1e101982ae578cd6b2680baabad870860c1dbe30 — Adrian Cochrane 3 years ago 23bd2df
Fix for more recent bytestring versions.

Otherwise it doesn't know which `strip` function to use...
1 files changed, 2 insertions(+), 2 deletions(-)

M src/Network/URI/Cache.hs
M src/Network/URI/Cache.hs => src/Network/URI/Cache.hs +2 -2
@@ 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