From 7a559a40dfdd96225570443f70b873875e3975c0 Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 22 May 2013 23:36:14 -0400 Subject: [PATCH] add regexes to post view route to fix a conflict with 2-level deep file paths --- src/blarg/routes/posts.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blarg/routes/posts.clj b/src/blarg/routes/posts.clj index aba7971..0056e66 100644 --- a/src/blarg/routes/posts.clj +++ b/src/blarg/routes/posts.clj @@ -107,7 +107,10 @@ (defroutes posts-routes (GET "/" [page] (list-page (parse-int page 0))) - (GET "/:year/:month/:day/:slug" [year month day slug] (show-post-page year month day slug)) + (GET + ["/:year/:month/:day/:slug" :year #"[0-9]{4}" :month #"[0-9]{1,2}" :day #"[0-9]{1,2}" :slug #"(.*)"] + [year month day slug] + (show-post-page year month day slug)) (restricted GET "/newpost" [] (new-post-page)) (restricted POST "/newpost" [title tags body] (handle-new-post title tags body)) (restricted GET "/editpost/:id" [id] (edit-post-page id))