Allow !# as well as #! #652
This commit is contained in:
parent
12480b2d2a
commit
47d136b057
@ -184,6 +184,7 @@ ttToType (TTList t) = ListT `AppT` ttToType t
|
||||
|
||||
pieceFromString :: String -> Either String (CheckOverlap, Piece String)
|
||||
pieceFromString ('#':'!':x) = Right $ (False, Dynamic x)
|
||||
pieceFromString ('!':'#':x) = Right $ (False, Dynamic x) -- https://github.com/yesodweb/yesod/issues/652
|
||||
pieceFromString ('#':x) = Right $ (True, Dynamic x)
|
||||
pieceFromString ('*':x) = Left x
|
||||
pieceFromString ('+':x) = Left x
|
||||
|
||||
@ -77,6 +77,8 @@ do
|
||||
let resources = [parseRoutes|
|
||||
/ HomeR GET
|
||||
|
||||
/!#Int BackwardsR GET
|
||||
|
||||
/admin/#Int AdminR:
|
||||
/ AdminRootR GET
|
||||
/login LoginR GET POST
|
||||
@ -141,6 +143,9 @@ getAfter :: Handler site String; getAfter = "after"
|
||||
getHomeR :: Handler site String
|
||||
getHomeR = "home"
|
||||
|
||||
getBackwardsR :: Int -> Handler site Text
|
||||
getBackwardsR _ = pack "backwards"
|
||||
|
||||
getAdminRootR :: Int -> Handler site Text
|
||||
getAdminRootR i = pack $ "admin root: " ++ show i
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod-routes
|
||||
version: 1.2.0.5
|
||||
version: 1.2.0.6
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user