Report full URL instead of bare origin for detected scripts and iframes

Strip query params and send origin+pathname so the backend can
distinguish resources served from the same domain but different paths
(e.g. gtm.js vs recaptcha/api.js on googletagmanager.com).

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-06 18:34:12 +04:00
parent 179e041e2f
commit a4cb61366f
3 changed files with 14 additions and 16 deletions

View File

@@ -30,6 +30,7 @@ import (
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
"go.probo.inc/probo/pkg/uri"
"go.probo.inc/probo/pkg/validator"
)
@@ -125,7 +126,7 @@ type (
}
DetectedResourceItem struct {
Origin string
URL uri.URI
ResourceType coredata.TrackerType
}
@@ -1992,7 +1993,7 @@ func (s *Service) ReportDetectedTrackers(
now,
detectedTrackerInfo{
TrackerType: dr.ResourceType,
Identifier: dr.Origin,
Identifier: dr.URL.String(),
},
&inserted,
); err != nil {