only send successful responses to analytics
1 file changed, 3 insertions(+), 3 deletions(-)
changed files
M domain/analytics/middleware.go → domain/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) + } }) } }