diff options
Diffstat (limited to 'lib/anubis.go')
| -rw-r--r-- | lib/anubis.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/anubis.go b/lib/anubis.go index 8d5dac1..114356c 100644 --- a/lib/anubis.go +++ b/lib/anubis.go @@ -162,7 +162,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (s *Server) challengeFor(r *http.Request, difficulty int) string { fp := sha256.Sum256(s.priv.Seed()) - data := fmt.Sprintf( + challengeData := fmt.Sprintf( "Accept-Language=%s,X-Real-IP=%s,User-Agent=%s,WeekTime=%s,Fingerprint=%x,Difficulty=%d", r.Header.Get("Accept-Language"), r.Header.Get("X-Real-Ip"), @@ -171,7 +171,7 @@ func (s *Server) challengeFor(r *http.Request, difficulty int) string { fp, difficulty, ) - return internal.SHA256sum(data) + return internal.SHA256sum(challengeData) } func (s *Server) MaybeReverseProxy(w http.ResponseWriter, r *http.Request) { @@ -326,9 +326,12 @@ func (s *Server) MaybeReverseProxy(w http.ResponseWriter, r *http.Request) { } func (s *Server) RenderIndex(w http.ResponseWriter, r *http.Request) { - templ.Handler( - web.Base("Making sure you're not a bot!", web.Index()), - ).ServeHTTP(w, r) + handler := internal.NoStoreCache( + templ.Handler( + web.Base("Making sure you\\'re not a bot!", web.Index()), + ), + ) + handler.ServeHTTP(w, r) } func (s *Server) MakeChallenge(w http.ResponseWriter, r *http.Request) { |
