Hi all,
The Snap team is pleased to announce the release of Snap 0.2.12.
Changes since 0.2.11
Improvements:
The Snap debugging system has been reworked; before, to get debugging output from a Snap program, you needed to build
snap-corewith the-fdebugflag and rebuild your entire webapp stack. Now, in a stock Snap installation, you can set the environment variableDEBUG=1to get Snap to produce debugging output to stderr.There is a slight performance hit associated with this change (in that GHC can no longer inline calls to
debugbecause we useunsafePerformIOto read theDEBUGenvironment variable to pick a debug implementation at runtime) — if you simply cannot stand the overhead of a no-op function call, pass theno-debugflag when installingsnap-core:
$ cabal install snap-core -fno-debugfixed a performance issue related to buffer handling in responses using
Transfer-Encoding: chunked.Many more tests have been written for
snap-server; test coverage for expressions is up in the 90%+ range now for most modules.
API Changes:
The function
unsafeDetachRequestBodynever worked and wasn’t designed properly; it’s been replaced with a much improvedtransformRequestBodyfunction which a) actually works, and b) doesn’t have issues re: unsafeness. Normally, following the package version policy would necessitate a minor version bump for this (to 0.3) but since the original function never worked in the first place, nobody could possibly be using it!The type of
finishWithhas been changed from:
finishWith :: Response -> Snap ()
to:
finishWith :: Response -> Snap a
Bugfixes:
The ‘redirect’ function would not allow you to set headers in the redirect response; this has been fixed.
GZip filter: set
Vary: Accept-Encodingon gzipped responses (for caching proxies)Shutdown logic for both
libevand standard backends has been reworked and improved; no more 2 second delays!