all repos — homestead @ 87cc8a9164a2cb510b17907387bc82d83a7b89dc

Code for my website

count redirects

Alan Pearce
commit

87cc8a9164a2cb510b17907387bc82d83a7b89dc

parent

2d70f5c77d9c7ae8f726aa455373a656bef4e654

1 file changed, 1 insertion(+), 0 deletions(-)

jump to
M internal/website/mux.gointernal/website/mux.go
@@ -44,6 +44,7 @@
func (website *Website) ServeHTTP(w http.ResponseWriter, r *http.Request) *ihttp.Error { urlPath, shouldRedirect := website.reader.CanonicalisePath(r.URL.Path) if shouldRedirect { + website.counter.Count(r, "302") http.Redirect(w, r, urlPath, 302) return nil