]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Postprocess.hs
The library compiles again.
[Lucu.git] / Network / HTTP / Lucu / Postprocess.hs
index 39b6b4c16f24ff608c12f1c59780225682915b91..bc9363d1115de6740032c1d858ac9baab4e65ea3 100644 (file)
@@ -9,7 +9,6 @@ module Network.HTTP.Lucu.Postprocess
     , completeUnconditionalHeaders
     )
     where
-import qualified Blaze.ByteString.Builder.Char.Utf8 as BB
 import Control.Applicative
 import Control.Concurrent.STM
 import Control.Monad
@@ -33,7 +32,6 @@ import Prelude.Unicode
 postprocess ∷ Interaction → STM ()
 postprocess itr@(Interaction {..})
     = do abortOnCertainConditions itr
-         writeDefaultPageIfNeeded itr
 
          case itrRequest of
            Just req → postprocessWithRequest itr req
@@ -115,9 +113,10 @@ writeDefaultPageIfNeeded itr@(Interaction {..})
     = do resHasCType ← readTVar itrResponseHasCType
          unless resHasCType
              $ do writeHeader itr "Content-Type" (Just defaultPageContentType)
+                  writeHeader itr "Content-Encoding" Nothing
                   res ← readTVar itrResponse
                   let page = getDefaultPage itrConfig itrRequest res
-                  putTMVar itrBodyToSend (BB.fromLazyText page)
+                  putTMVar itrBodyToSend page
 
 writeHeader ∷ Interaction → CIAscii → Maybe Ascii → STM ()
 {-# INLINE writeHeader #-}
@@ -144,6 +143,7 @@ updateResIO (Interaction {..}) f
          new ← unsafeIOToSTM $ f old
          writeTVar itrResponse new
 
+-- FIXME: Narrow the use of IO monad!
 completeUnconditionalHeaders ∷ Config → Response → IO Response
 completeUnconditionalHeaders conf = (compDate =≪) ∘ compServer
       where