on master help sign in
Change from deprecated `breakByte` to `break`.
commitbe9983eeb4191e07c432a76b3662066624e53e57 authorMikkel Christiansen <mikkel@rheosystems.com> dateWed 29 Jul 2015, 14:15 (11 years ago) parent15a3c51
2 files changed+3−2
wai-extra/Network/Wai/Middleware/Gzip.hs+2−1 wai-extra/Network/Wai/Middleware/HttpAuth.hs+1−1
wai-extra/Network/Wai/Middleware/Gzip.hs+2−1
@@ -42,6 +42,7 @@ import Data.Function (fix)
4242import Control.Exception (throwIO)
4343import qualified System.IO as IO
4444import Data.ByteString.Lazy.Internal (defaultChunkSize)
45+import Data.Word8 (_semicolon)
4546
4647data GzipSettings = GzipSettings
4748 { gzipFiles :: GzipFiles
@@ -58,7 +59,7 @@ defaultCheckMime :: S.ByteString -> Bool
5859defaultCheckMime bs =
5960 S8.isPrefixOf "text/" bs || bs' `Set.member` toCompress
6061 where
61− bs' = fst $ S.breakByte 59 bs -- semicolon
62+ bs' = fst $ S.break (== _semicolon) bs
6263 toCompress = Set.fromList
6364 [ "application/json"
6465 , "application/javascript"
wai-extra/Network/Wai/Middleware/HttpAuth.hs+1−1
@@ -109,7 +109,7 @@ extractBasicAuth bs =
109109 where
110110 extract encoded =
111111 let raw = decodeLenient encoded
112− (username, password') = S.breakByte _colon raw
112+ (username, password') = S.break (== _colon) raw
113113 in ((username,) . snd) <$> S.uncons password'
114114
115115-- | Extract bearer authentication data from __Authorization__ header