The Snap team is pleased to announce the release of Snap 0.2.12.
Changes since 0.2.11
The Snap debugging system has been reworked; before, to get debugging output from a Snap program, you needed to build
-fdebugflag and rebuild your entire webapp stack. Now, in a stock Snap installation, you can set the environment variable
DEBUG=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 use
unsafePerformIOto read the
DEBUGenvironment variable to pick a debug implementation at runtime) — if you simply cannot stand the overhead of a no-op function call, pass the
no-debugflag when installing
$ cabal install snap-core -fno-debug
fixed a performance issue related to buffer handling in responses using
Many more tests have been written for
snap-server; test coverage for expressions is up in the 90%+ range now for most modules.
unsafeDetachRequestBodynever worked and wasn’t designed properly; it’s been replaced with a much improved
transformRequestBodyfunction 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 ()
finishWith :: Response -> Snap a
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!