feat: add responseWrapper to exclude errors (status codes >= 400) from being reported

This commit is contained in:
Oleh Astappiev 2024-12-08 21:46:35 +01:00
parent 02f9dd951c
commit a978d4921d
No known key found for this signature in database
GPG key ID: 37D7AC22589E9632
4 changed files with 78 additions and 6 deletions

View file

@ -46,7 +46,7 @@ var headersToCopy = []string{
// Copied and adapted from https://github.com/safing/plausiblefeeder/blob/master/event.go
// Licensed as MIT license
func (h *UmamiFeeder) submitToFeed(req *http.Request) {
func (h *UmamiFeeder) submitToFeed(req *http.Request, code int) {
body := SendBody{
Payload: SendPayload{
Hostname: parseDomainFromHost(req.Host),