fix(backend): fixed an issue in url_path builder
This commit is contained in:
parent
b6ba3aceb9
commit
2cd210fbaa
1 changed files with 10 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue