From 4577e01091607fa521b6f488cff2ef258caeaee0 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 18 Jun 2012 23:32:39 +0200 Subject: Fix profile page handling. --- src/mulk/benki/id.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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)) -- cgit v1.2.3