Permalink
Browse files

Moved page handler above source and any handlers.

Resolves Issue #15 (when a directory and a page were
created with the same name, attempts to load the page
would fail).
  • Loading branch information...
1 parent 6ee3269 commit f1f5315dee19280dc77089e1f516b1766369e09f @jgm committed Feb 1, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 Gitit.hs
View
@@ -138,9 +138,10 @@ wikiHandlers = [ handlePath "_index" GET indexPage
, withCommand "update" [ handlePage POST $ unlessNoEdit (ifLoggedIn updatePage loginUserForm) showPage ]
, withCommand "delete" [ handlePage GET $ unlessNoDelete (ifLoggedIn confirmDelete loginUserForm) showPage,
handlePage POST $ unlessNoDelete (ifLoggedIn deletePage loginUserForm) showPage ]
+ , handlePage GET showPage
, handleSourceCode
, handleAny
- , handlePage GET showPage
+ , handlePage GET createPage
]
handleSourceCode :: Handler
@@ -223,7 +224,7 @@ showPage page params = do
rev <- liftIO $ latest fs (pathForPage page)
cacheContents (pathForPage page) rev c
formattedPage (defaultPageLayout { pgScripts = ["jsMath/easy/load.js" | jsMathExists]}) page params c
- Nothing -> createPage page params
+ Nothing -> noHandle
discussPage :: String -> Params -> Web Response
discussPage page params = do

0 comments on commit f1f5315

Please sign in to comment.