From 7b7cbc950b42083ffbffcd7d68c53b202681e8c3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 5 Feb 2011 19:58:14 +0200 Subject: [PATCH] Fix remoteHost session issue --- Yesod/Core.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Yesod/Core.hs b/Yesod/Core.hs index 82ef97df..81611667 100644 --- a/Yesod/Core.hs +++ b/Yesod/Core.hs @@ -239,9 +239,8 @@ defaultYesodRunner s master toMasterRoute mkey murl handler req = do now <- liftIO getCurrentTime let getExpires m = fromIntegral (m * 60) `addUTCTime` now let exp' = getExpires $ clientSessionDuration master - -- FIXME will show remoteHost give the answer I need? will it include port - -- information that changes on each request? - let host = if sessionIpAddress master then S8.pack (show (W.remoteHost req)) else "" + let rh = takeWhile (/= ':') $ show $ W.remoteHost req + let host = if sessionIpAddress master then S8.pack rh else "" let session' = case mkey of Nothing -> []