From 45b43437477929531d1c54f7ff2ab993bf613924 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 11 Apr 2010 12:56:54 -0700 Subject: [PATCH] Implemented getMethod --- Yesod/Yesod.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Yesod/Yesod.hs b/Yesod/Yesod.hs index 25f5e0f3..47cac882 100644 --- a/Yesod/Yesod.hs +++ b/Yesod/Yesod.hs @@ -16,6 +16,7 @@ import Yesod.Request import Yesod.Definitions import Yesod.Handler import qualified Data.ByteString as B +import qualified Data.ByteString.Char8 as B8 import Data.Maybe (fromMaybe) import Web.Mime @@ -153,7 +154,9 @@ toWaiApp' y resource session env = do responseToWaiResponse res getMethod :: (String -> YesodApp y) -> YesodApp y -getMethod = error "FIXME: getMethod" +getMethod f eh req cts = + let m = B8.unpack $ W.methodToBS $ W.requestMethod $ reqWaiRequest req + in f m eh req cts cleanupSegment :: B.ByteString -> String cleanupSegment = error "FIXME: cleanupSegment"