diff --git a/Yesod/Internal/Core.hs b/Yesod/Internal/Core.hs index 842e0008..3fa63128 100644 --- a/Yesod/Internal/Core.hs +++ b/Yesod/Internal/Core.hs @@ -206,11 +206,11 @@ class RenderRoute (Route a) => Yesod a where -- | Join the pieces of a path together into an absolute URL. This should -- be the inverse of 'splitPath'. joinPath :: a - -> Builder -- ^ application root + -> TS.Text -- ^ application root -> [TS.Text] -- ^ path pieces -> [(TS.Text, TS.Text)] -- ^ query string -> Builder - joinPath _ ar pieces' qs' = ar `mappend` encodePath pieces qs + joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where pieces = if null pieces' then [""] else pieces' qs = map (TE.encodeUtf8 *** go) qs' @@ -569,7 +569,7 @@ yesodRender :: Yesod y yesodRender y u qs = TE.decodeUtf8 $ toByteString $ fromMaybe - (joinPath y (fromText $ approot y) ps + (joinPath y (approot y) ps $ qs ++ qs') (urlRenderOverride y u) where diff --git a/Yesod/Internal/Dispatch.hs b/Yesod/Internal/Dispatch.hs index 32a60fc1..48664bb0 100644 --- a/Yesod/Internal/Dispatch.hs +++ b/Yesod/Internal/Dispatch.hs @@ -23,8 +23,6 @@ import Network.HTTP.Types (status301) import Data.Text (Text) import Data.Monoid (mappend) import qualified Blaze.ByteString.Builder -import qualified Blaze.ByteString.Builder.Char8 -import Blaze.ByteString.Builder.Char.Utf8 (fromText) import qualified Data.ByteString.Char8 as S8 {-| @@ -87,7 +85,7 @@ sendRedirect y segments' env = , ("Location", Blaze.ByteString.Builder.toByteString dest') ] "Redirecting" where - dest = joinPath y (fromText $ approot y) segments' [] + dest = joinPath y (approot y) segments' [] dest' = if S.null (W.rawQueryString env) then dest