on master help sign in
Got rid of gzip/gzip' divide
6fcaa10Michael Snoyman
wai-extra/Network/Wai/Middleware/Gzip.hs+2−9
@@ -16,7 +16,6 @@
16---------------------------------------------------------
16---------------------------------------------------------
17module Network.Wai.Middleware.Gzip
17module Network.Wai.Middleware.Gzip
18 ( gzip
18 ( gzip
19− , gzip'
20 , GzipSettings
19 , GzipSettings
21 , gzipFiles
20 , gzipFiles
22 , GzipFiles (..)
21 , GzipFiles (..)
@@ -62,14 +61,8 @@ defaultCheckMime = S8.isPrefixOf "text/"
62-- Possible future enhancements:
61-- Possible future enhancements:
63--
62--
64-- * Only compress if the response is above a certain size.
63-- * Only compress if the response is above a certain size.
65−gzip :: Bool -- ^ should we gzip files?
66− -> Middleware
67−gzip files = gzip' def
68− { gzipFiles = if files then GzipCompress else GzipIgnore
69− }
70−
71−gzip' :: GzipSettings -> Middleware
64+gzip :: GzipSettings -> Middleware
72−gzip' set app env = do
65+gzip set app env = do
73 res <- app env
66 res <- app env
74 case res of
67 case res of
75 ResponseFile{} | gzipFiles set == GzipIgnore -> return res
68 ResponseFile{} | gzipFiles set == GzipIgnore -> return res
wai-extra/test/WaiExtraTest.hs+1−1
@@ -261,7 +261,7 @@ caseJsonp = flip runSession jsonpApp $ do
261 assertBody "{\"foo\":\"bar\"}" sres3
261 assertBody "{\"foo\":\"bar\"}" sres3
262
262
263gzipApp :: Application
263gzipApp :: Application
264−gzipApp = gzip True $ const $ return $ responseLBS status200
264+gzipApp = gzip def $ const $ return $ responseLBS status200
265 [("Content-Type", "text/plain")]
265 [("Content-Type", "text/plain")]
266 "test"
266 "test"
267
267