tests pass, except clean path

This commit is contained in:
Michael Snoyman 2012-01-03 20:41:48 +02:00
parent c499e880b6
commit 03da3b021a
2 changed files with 5 additions and 3 deletions

View File

@ -43,6 +43,8 @@ import Data.ByteString.Lazy.Char8 ()
import Web.ClientSession
import Data.Char (isUpper)
import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8With)
import Data.Text.Encoding.Error (lenientDecode)
import Data.Monoid (mappend)
import qualified Data.ByteString as S
import qualified Blaze.ByteString.Builder
@ -170,8 +172,8 @@ toWaiApp' y key' env =
yesodDispatch y y id app404 handler405 method (W.pathInfo env) key' env
where
app404 = yesodRunner notFound y y Nothing id
handler405 = error "handler405"
method = error "method"
handler405 route = yesodRunner badMethod y y (Just route) id
method = decodeUtf8With lenientDecode $ W.requestMethod env
sendRedirect :: Yesod master => master -> [Text] -> W.Application
sendRedirect y segments' env =

View File

@ -600,7 +600,7 @@ notFound :: GHandler sub master a
notFound = hcError NotFound
-- | Return a 405 method not supported page.
badMethod :: GHandler s m a
badMethod :: GHandler sub master a
badMethod = do
w <- waiRequest
hcError $ BadMethod $ W.requestMethod w