@@ -25,18 +25,6 @@ import System.FilePath
2525import Text.RawString.QQ
2626import Control.Monad.IO.Class
2727
28−
29−{- | Takes a port number and session handle to determine if what has been
30− - passed is an HTTPS Session. If not, it will request URI along with the name
31− - of host and return a HTTPS redirect. -}
32−ensureSecure :: Int -> Handler a b () -> Handler a b ()
33−ensureSecure port h = do
34− s <- getsRequest rqIsSecure
35− if s then h else do
36− uri <- getsRequest rqURI
37− host <- getsRequest rqHostName --TODO: It might be better to use the canonical base of the server
38− redirect $ "https://" <> host <> (if port == 443 then "" else ":" <> fromString (show port)) <> uri
39−
4028-- Data type for web app configuration
4129data AppConfig m
4230 = AppConfig { _appConfig_logo :: Diagram SVG
@@ -107,7 +95,7 @@ serveStaticIndex cfg = do
10795 -- Render and write html head and body to response
10896 writeLBS $ renderBS $ doctypehtml_ $ do
10997 head_ $ do
110− meta_ [charset_ "utf-8"] -- meta-data charset description
98+ meta_ [charset_ "utf-8"] -- meta-data charset description
11199 meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0"] -- meta-data viewport description
112100 _appConfig_extraHeadMarkup cfg -- any additional <head> html from 'AppConfig' type
113101 toHtmlRaw initialHead -- HtmlT monad wrapper