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 Web.ClientSession
import Data.Char (isUpper) import Data.Char (isUpper)
import Data.Text (Text) import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8With)
import Data.Text.Encoding.Error (lenientDecode)
import Data.Monoid (mappend) import Data.Monoid (mappend)
import qualified Data.ByteString as S import qualified Data.ByteString as S
import qualified Blaze.ByteString.Builder 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 yesodDispatch y y id app404 handler405 method (W.pathInfo env) key' env
where where
app404 = yesodRunner notFound y y Nothing id app404 = yesodRunner notFound y y Nothing id
handler405 = error "handler405" handler405 route = yesodRunner badMethod y y (Just route) id
method = error "method" method = decodeUtf8With lenientDecode $ W.requestMethod env
sendRedirect :: Yesod master => master -> [Text] -> W.Application sendRedirect :: Yesod master => master -> [Text] -> W.Application
sendRedirect y segments' env = sendRedirect y segments' env =

View File

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