Skip to content

Commit

Permalink
replace path.Join with url.JoinPath
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Aug 28, 2024
1 parent cbe91b0 commit 920f0e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/pkg/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"net"
"net/http"
"path"
neturl "net/url"
"sync"

"github.com/kubeshop/tracetest/cli/ui"
Expand Down Expand Up @@ -59,7 +59,10 @@ func (s *OAuthServer) GetAuthJWT() error {
return fmt.Errorf("failed to start oauth server: %w", err)
}

loginUrl := path.Join(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))
loginUrl, err := neturl.JoinPath(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))
if err != nil {
return fmt.Errorf("could not build path: %w", err)
}

ui := ui.DefaultUI
err = ui.OpenBrowser(loginUrl)
Expand Down

0 comments on commit 920f0e8

Please sign in to comment.