summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-06-18 23:32:39 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-06-18 23:32:39 +0200
commit4577e01091607fa521b6f488cff2ef258caeaee0 (patch)
treee02d0a1bccd560aec2c5579ca6e9a2f742613220
parentc416d211c261292d77d45ab12f10ce44b6ac036b (diff)
Fix profile page handling.
-rw-r--r--src/mulk/benki/id.clj7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mulk/benki/id.clj b/src/mulk/benki/id.clj
index 20925e7..5e6376f 100644
--- a/src/mulk/benki/id.clj
+++ b/src/mulk/benki/id.clj
@@ -126,11 +126,14 @@
(defpage [:post "/openid/api"] {}
(process-openid-request))
-(defpage [:get "/id/:nickname"] {nickname :nickname}
+(defn render-profile-page [nickname]
(if (re-find #"application/xrds\+xml"
(get-in (request/ring-request) [:headers "accept"]))
(render-xrds nickname)
(show-profile-page (nickname-user nickname))))
+(defpage [:get "/id/:nickname"] {nickname :nickname}
+ (render-profile-page nickname))
+
(defpage [:get "/~:nickname"] {nickname :nickname}
- (redirect (link :profile nickname)))
+ (render-profile-page nickname))