fix(backend): fixed an issue in url_path builder

This commit is contained in:
Alexander 2024-06-27 13:00:23 +02:00
parent b6ba3aceb9
commit 2cd210fbaa

View file

@ -334,7 +334,11 @@ func (c *connectorImpl) InsertWebResourceEvent(session *sessions.Session, msg *m
fullPath := ""
_, path, query, err := url.GetURLParts(msg.URL)
if err == nil {
fullPath = strings.ToLower(path + "?" + query)
pathQuery := path
if query != "" {
pathQuery += "?" + query
}
fullPath = strings.ToLower(pathQuery)
} else {
log.Printf("can't parse url: %s", err)
}
@ -363,7 +367,11 @@ func (c *connectorImpl) InsertWebPageEvent(session *sessions.Session, msg *messa
fullPath := ""
_, path, query, err := url.GetURLParts(msg.URL)
if err == nil {
fullPath = strings.ToLower(path + "?" + query)
pathQuery := path
if query != "" {
pathQuery += "?" + query
}
fullPath = strings.ToLower(pathQuery)
} else {
log.Printf("can't parse url: %s", err)
}