X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=examples%2FSSL.hs;h=b9b76a3919e7c12f7930c08b2714f5d47d568637;hp=48b23813fbee4f2a746b2940fadf9252cba06965;hb=b22e702f8161447a460847c6e6c97104c150534f;hpb=ac2ff93f647d60d43ca3cc54eb776fe0f701ac9e diff --git a/examples/SSL.hs b/examples/SSL.hs index 48b2381..b9b76a3 100644 --- a/examples/SSL.hs +++ b/examples/SSL.hs @@ -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