wai-extra 3.0.15.1 → 3.0.15.2
raw patch · 3 files changed
+18/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Network/Wai/Middleware/Gzip.hs +13/−4
- wai-extra.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 3.0.15.2++* Doc improvements+ ## 3.0.15.1 * don't use deprecated CRT functions on Windows [#544](https://github.com/yesodweb/wai/pull/544)
Network/Wai/Middleware/Gzip.hs view
@@ -50,12 +50,23 @@ , gzipCheckMime :: S.ByteString -> Bool } -data GzipFiles = GzipIgnore | GzipCompress | GzipCacheFolder FilePath+-- | Gzip behavior for files.+data GzipFiles+ = GzipIgnore -- ^ Do not compress file responses.+ | GzipCompress -- ^ Compress files. Note that this may counteract+ -- zero-copy response optimizations on some+ -- platforms.+ | GzipCacheFolder FilePath -- ^ Compress files, caching them in+ -- some directory. deriving (Show, Eq, Read) +-- | Use default MIME settings; /do not/ compress files. instance Default GzipSettings where def = GzipSettings GzipIgnore defaultCheckMime +-- | MIME types that will be compressed by default:+-- @text/*@, @application/json@, @application/javascript@,+-- @application/ecmascript@, @image/x-icon@. defaultCheckMime :: S.ByteString -> Bool defaultCheckMime bs = S8.isPrefixOf "text/" bs || bs' `Set.member` toCompress@@ -73,9 +84,7 @@ -- Analyzes the \"Accept-Encoding\" header from the client to determine -- if gzip is supported. ----- Possible future enhancements:------ * Only compress if the response is above a certain size.+-- File responses will be compressed according to the 'GzipFiles' setting. gzip :: GzipSettings -> Middleware gzip set app env sendResponse = app env $ \res -> case res of
wai-extra.cabal view
@@ -1,5 +1,5 @@ Name: wai-extra-Version: 3.0.15.1+Version: 3.0.15.2 Synopsis: Provides some basic WAI handlers and middleware. description: Provides basic WAI handler and middleware functionality: