Skip to content

Commit

Permalink
fix: do not uses url.JoinPath for strava api
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 1, 2024
1 parent 5c06654 commit b7dacd0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions internal/apis/strava/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ package strava

import (
"net/http"
"net/url"

"github.com/gleich/lcp-v2/internal/apis"
"github.com/gleich/lumber/v3"
)

func sendStravaAPIRequest[T any](path string, tokens tokens) (T, error) {
var zeroValue T
u, err := url.JoinPath("https://www.strava.com/", path)
if err != nil {
lumber.Error(err, "failed to join URL")
return zeroValue, err
}

req, err := http.NewRequest("GET", u, nil)
req, err := http.NewRequest("GET", "https://www.strava.com/"+path, nil)
if err != nil {
lumber.Error(err, "failed to create request")
return zeroValue, err
Expand Down

0 comments on commit b7dacd0

Please sign in to comment.