Document Snap workaround

This commit is contained in:
Johan Tibell 2011-12-29 18:35:11 -08:00
parent a2e9955fe5
commit 1a2d637a4e

View file

@ -285,6 +285,9 @@ format fmt action = do
serveAll :: IORef Counters -> Snap () serveAll :: IORef Counters -> Snap ()
serveAll counters = do serveAll counters = do
req <- getRequest req <- getRequest
-- Workaround: Snap still matches requests to /foo to this handler
-- if the Accept header is "application/json", even though such
-- requests ought to go to the 'serveOne' handler.
unless (S.null $ rqPathInfo req) pass unless (S.null $ rqPathInfo req) pass
modifyResponse $ setContentType "application/json" modifyResponse $ setContentType "application/json"
gcStats <- liftIO Stats.getGCStats gcStats <- liftIO Stats.getGCStats