Skip to content

Commit

Permalink
Change from deprecated breakByte to break.
Browse files Browse the repository at this point in the history
  • Loading branch information
mschristiansen committed Jul 29, 2015
1 parent 15a3c51 commit be9983e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wai-extra/Network/Wai/Middleware/Gzip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import Data.Function (fix)
import Control.Exception (throwIO)
import qualified System.IO as IO
import Data.ByteString.Lazy.Internal (defaultChunkSize)
import Data.Word8 (_semicolon)

data GzipSettings = GzipSettings
{ gzipFiles :: GzipFiles
Expand All @@ -58,7 +59,7 @@ defaultCheckMime :: S.ByteString -> Bool
defaultCheckMime bs =
S8.isPrefixOf "text/" bs || bs' `Set.member` toCompress
where
bs' = fst $ S.breakByte 59 bs -- semicolon
bs' = fst $ S.break (== _semicolon) bs
toCompress = Set.fromList
[ "application/json"
, "application/javascript"
Expand Down
2 changes: 1 addition & 1 deletion wai-extra/Network/Wai/Middleware/HttpAuth.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extractBasicAuth bs =
where
extract encoded =
let raw = decodeLenient encoded
(username, password') = S.breakByte _colon raw
(username, password') = S.break (== _colon) raw
in ((username,) . snd) <$> S.uncons password'

-- | Extract bearer authentication data from __Authorization__ header
Expand Down

0 comments on commit be9983e

Please sign in to comment.