fix(backend): url path correct parsing

This commit is contained in:
ShiKhu 2022-04-22 00:29:25 +02:00
parent 77e7ad4edb
commit 0716819492
2 changed files with 7 additions and 3 deletions

View file

@ -85,7 +85,7 @@ func (conn *Conn) InsertWebPageEvent(sessionID uint64, e *PageEvent) error {
host, path, query, host, path, query,
e.DomContentLoadedEventEnd, e.LoadEventEnd, e.ResponseEnd, e.FirstPaint, e.FirstContentfulPaint, e.DomContentLoadedEventEnd, e.LoadEventEnd, e.ResponseEnd, e.FirstPaint, e.FirstContentfulPaint,
e.SpeedIndex, e.VisuallyComplete, e.TimeToInteractive, e.SpeedIndex, e.VisuallyComplete, e.TimeToInteractive,
calcResponseTime(e), calcDomBuildingTime(e) calcResponseTime(e), calcDomBuildingTime(e),
); err != nil { ); err != nil {
return err return err
} }

View file

@ -14,6 +14,10 @@ func GetURLParts(rawURL string) (string, string, string, error) {
if err != nil { if err != nil {
return "", "", "", err return "", "", "", err
} }
// u.Scheme ? // u.Scheme u.Fragment / RawFragment ?
return u.Host, u.RawPath, u.RawQuery, nil path := u.Path
if u.RawPath != "" {
path = u.RawPath
}
return u.Host, path, u.RawQuery, nil
} }