From b0d5e78662056759d6a875d6414296fba5733c3a Mon Sep 17 00:00:00 2001 From: Umputun Date: Tue, 2 Jan 2018 12:23:49 -0600 Subject: [PATCH] fix tree cache --- README.md | 2 +- app/rest/server.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf64489c..97d840fc 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ _instructions for google oauth2 setup borrowed from [oauth2_proxy](https://githu 1. Set **"Display Name"** and **"Contact email"** 1. Choose **"Facebook Login"** and then **"Web"** 1. Set "Site URL" to your domain, ex: `https://remark42.mysite.com` -1. Under **"Facebook"/"Settings"** fill "Valid OAuth redirect URIs" with your callback url constructed as domain + `/auth/facebook/callback` +1. Under **"Facebook login"** / **"Settings"** fill "Valid OAuth redirect URIs" with your callback url constructed as domain + `/auth/facebook/callback` 1. Select **"App Review"** and turn public flag on. This step may ask you to provide a link to your privacy policy. ### Frontend diff --git a/app/rest/server.go b/app/rest/server.go index 4ee288a3..6c830e32 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -187,8 +187,9 @@ func (s *Server) findCommentsCtrl(w http.ResponseWriter, r *http.Request) { comments = s.mod.maskBlockedUsers(comments) if r.URL.Query().Get("format") == "tree" { - s.respCache.Set(cacheKey, comments, time.Hour) - renderJSONWithHTML(w, r, format.MakeTree(comments, r.URL.Query().Get("sort"))) + treeComments := format.MakeTree(comments, r.URL.Query().Get("sort")) + s.respCache.Set(cacheKey, treeComments, time.Hour) + renderJSONWithHTML(w, r, treeComments) return }