X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FResource%2FRender.hs;h=fdb3d87afca2428192ce49aef855f91e81538a84;hb=706ee842873fdceb9465cdf6a583176ab855fae2;hp=c25ca586fc628cdafcd19dd176f19eec73342d3a;hpb=b444493e17ad49d60464bb5cf02898bd9198af3c;p=Rakka.git diff --git a/Rakka/Resource/Render.hs b/Rakka/Resource/Render.hs index c25ca58..fdb3d87 100644 --- a/Rakka/Resource/Render.hs +++ b/Rakka/Resource/Render.hs @@ -3,16 +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 @@ -68,7 +68,7 @@ handleRender env name let (bin, cType) = case cTypeM of Just (MIMEType "application" "x-rakka-base64-stream" _) - -> let b = Lazy.pack $ fromJust $ B64.decode $ L8.unpack entity + -> let b = decodeBase64LBS entity in (b, guessMIMEType b) Just t @@ -85,7 +85,7 @@ handleRender env name >>> writeDocumentToString [ (a_indent, v_1) ] ) - output xmlStr + output $ UTF8.encodeString xmlStr render :: (ArrowXml a, ArrowChoice a, ArrowIO a) =>