From 25a102f1a573e2c5ff2c5c1684b268bbb351a5aa Mon Sep 17 00:00:00 2001 From: Damjan Znidarsic Date: Fri, 30 Aug 2024 14:23:11 +0100 Subject: [PATCH] fix empty ports --- pkg/protocol/snowplow/eventBuilder.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/protocol/snowplow/eventBuilder.go b/pkg/protocol/snowplow/eventBuilder.go index 375ebdcf..5f66b42a 100644 --- a/pkg/protocol/snowplow/eventBuilder.go +++ b/pkg/protocol/snowplow/eventBuilder.go @@ -164,6 +164,12 @@ func getPageFromParam(params map[string]interface{}, k string) (Page, error) { qParams := util.QueryToMap(parsedUrl.Query()) frag := parsedUrl.Fragment port := parsedUrl.Port() + if port == "" { + port = "80" + if parsedUrl.Scheme == "https" { + port = "443" + } + } page := Page{ Url: p, Scheme: &parsedUrl.Scheme,