]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/SSL.hs
Unfoldable Dispatcher
[Lucu.git] / examples / SSL.hs
index 48b23813fbee4f2a746b2940fadf9252cba06965..b9b76a3919e7c12f7930c08b2714f5d47d568637 100644 (file)
@@ -1,6 +1,7 @@
 {-# LANGUAGE
     OverloadedStrings
   , PackageImports
+  , QuasiQuotes
   , UnicodeSyntax
   #-}
 import Control.Applicative
@@ -40,13 +41,13 @@ helloWorld ∷ ResourceDef
 helloWorld 
     = emptyResource {
         resGet
-          = Just $ do setContentType $ parseMIMEType "text/plain"
-                      outputChunk "getRemoteCertificate = "
+          = Just $ do setContentType [mimeType| text/plain |]
+                      putChunk "getRemoteCertificate = "
                       cert ← do cert ← getRemoteCertificate
                                 case cert of
                                   Just c  → liftIO $ Lazy.pack <$> printX509 c
                                   Nothing → return "Nothing"
-                      outputChunk cert
+                      putChunks cert
       }
 
 genCert ∷ KeyPair k ⇒ k → IO X509