diff --git a/yesod-auth/openid.hs b/yesod-auth/openid.hs index 74105021..ebf1863d 100644 --- a/yesod-auth/openid.hs +++ b/yesod-auth/openid.hs @@ -11,8 +11,9 @@ import Text.Hamlet (hamlet) import Control.Monad.IO.Class (liftIO) import Yesod.Form import Network.Wai.Handler.Warp (run) +import Network.HTTP.Conduit -data BID = BID +data BID = BID { httpManager :: Manager } mkYesod "BID" [parseRoutes| / RootR GET @@ -44,11 +45,14 @@ instance YesodAuth BID where loginDest _ = AfterLoginR logoutDest _ = AuthR LoginR getAuthId = return . Just . credsIdent - authPlugins = [authOpenId] + authPlugins _ = [authOpenId] + authHttpManager = httpManager instance RenderMessage BID FormMessage where renderMessage _ _ = defaultFormMessage main :: IO () -main = toWaiApp BID >>= run 3000 +main = do + m <- newManager def + toWaiApp (BID m) >>= run 3000 diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index 2a1b0adf..69900408 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -42,7 +42,7 @@ library , persistent >= 0.8 && < 0.9 , persistent-template >= 0.8 && < 0.9 , SHA >= 1.4.1.3 && < 1.6 - , http-conduit >= 1.2 && < 1.3 + , http-conduit >= 1.2.5 && < 1.3 , aeson >= 0.5 , pwstore-fast >= 2.2 && < 3 , lifted-base >= 0.1 && < 0.2 diff --git a/yesod-core/Yesod/Internal/Core.hs b/yesod-core/Yesod/Internal/Core.hs index 6018642c..ce4e4e82 100644 --- a/yesod-core/Yesod/Internal/Core.hs +++ b/yesod-core/Yesod/Internal/Core.hs @@ -414,7 +414,7 @@ defaultYesodRunner handler master sub murl toMasterRoute mkey req = do hs' = case mkey of Nothing -> hs - Just _ -> AddCookie SetCookie + Just _ -> AddCookie def { setCookieName = sessionName , setCookieValue = sessionVal , setCookiePath = Just (cookiePath master) @@ -527,8 +527,8 @@ widgetToPageContent w = do master <- getYesod ((), GWData (Body body) (Last mTitle) scripts' stylesheets' style jscript (Head head')) <- unGWidget w let title = maybe mempty unTitle mTitle - let scripts = runUniqueList scripts' - let stylesheets = runUniqueList stylesheets' + scripts = runUniqueList scripts' + stylesheets = runUniqueList stylesheets' render <- getUrlRenderParams let renderLoc x = @@ -552,22 +552,11 @@ widgetToPageContent w = do $ encodeUtf8 $ renderJavascriptUrl render s return $ renderLoc x - let addAttr x (y, z) = x ! customAttribute (textTag y) (toValue z) - let renderLoc' render' (Local url) = render' url [] - renderLoc' _ (Remote s) = s - let mkScriptTag (Script loc attrs) render' = - foldl' addAttr TBH.script (("src", renderLoc' render' loc) : attrs) $ return () - let mkLinkTag (Stylesheet loc attrs) render' = - foldl' addAttr TBH.link - ( ("rel", "stylesheet") - : ("href", renderLoc' render' loc) - : attrs - ) - let left (Left x) = Just x - left _ = Nothing - right (Right x) = Just x - right _ = Nothing - let head'' = [HAMLET| + -- modernizr should be at the end of the
http://www.modernizr.com/docs/#installing + -- the asynchronous loader means your page doesn't have to wait for all the js to load + let (mcomplete, ynscripts) = ynHelper render scripts jscript jsLoc + headAll = [HAMLET| +\^{head'} $forall s <- stylesheets ^{mkLinkTag s} $forall s <- css @@ -581,20 +570,6 @@ $forall s <- css