]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Resource/Render.hs
Fixed breakage on newer HXT
[Rakka.git] / Rakka / Resource / Render.hs
index 778ca2114dba15d8945674510b1c70abc70c3a55..fdb3d87afca2428192ce49aef855f91e81538a84 100644 (file)
@@ -3,15 +3,16 @@ module Rakka.Resource.Render
     )
     where
 
-import qualified Codec.Binary.Base64 as B64
+import qualified Codec.Binary.UTF8.String as UTF8
 import           Control.Arrow
 import           Control.Arrow.ArrowIO
 import           Control.Arrow.ArrowList
 import           Control.Monad.Trans
-import qualified Data.ByteString.Lazy as Lazy (ByteString, pack)
-import qualified Data.ByteString.Lazy.Char8 as L8 hiding (ByteString)
+import qualified Data.ByteString.Lazy as Lazy
+import           Data.Maybe
 import           Network.HTTP.Lucu
 import           Network.HTTP.Lucu.Utils
+import           OpenSSL.EVP.Base64
 import           Rakka.Environment
 import           Rakka.Page
 import           Rakka.Utils
@@ -67,7 +68,7 @@ handleRender env name
 
          let (bin, cType) = case cTypeM of
                               Just (MIMEType "application" "x-rakka-base64-stream" _)
-                                  -> let b = Lazy.pack $ B64.decode $ L8.unpack entity
+                                  -> let b = decodeBase64LBS entity
                                      in
                                        (b, guessMIMEType b)
                               Just t
@@ -84,7 +85,7 @@ handleRender env name
                                      >>>
                                      writeDocumentToString [ (a_indent, v_1) ]
                                    )
-         output xmlStr
+         output $ UTF8.encodeString xmlStr
 
 
 render :: (ArrowXml a, ArrowChoice a, ArrowIO a) =>