all repos — homestead @ 7cc6162387db91d5be21121d8c6d232f06b513ad

Code for my website

only send successful responses to analytics

Alan Pearce
commit

7cc6162387db91d5be21121d8c6d232f06b513ad

parent

4bbbd38124322ce51bba65298c6143e0e6d1a746

1 file changed, 3 insertions(+), 3 deletions(-)

changed files
M domain/analytics/middleware.godomain/analytics/middleware.go
@@ -32,12 +32,12 @@ countKey, ok := GetCountKey(r)
if !ok { if rw.Status >= 201 { countKey = http.StatusText(rw.Status) - } else { - countKey = r.URL.Path } } - counter.Count(r, countKey) + if rw.Status <= 299 { + counter.Count(r, countKey) + } }) } }