tests pass, except clean path
This commit is contained in:
parent
c499e880b6
commit
03da3b021a
@ -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 =
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user